Tag Info

Hot answers tagged

7

By default, DynamicModule uses SynchronousInitialization -> True. This causes the initialization to be performed on the preemptive link, disabling any updates to the front-end. In particular, print statements, cell creation and dynamic box updates will all be deferred until the initialization completes. If we wish to monitor that initialization within ...


6

I think your problem is probably related to the way OptionValue[name] is evaluated. When you use a regular List instead of an Association, you'll find the whole thing works. I don't have the mathematica-fu to understand why in detail, but here is an alternative solution that makes your function definitions pretty concise. Define a utility function that ...


5

I believe this results from Association being atomic (or "not NormalQ" as Taliesin puts it) without being fully overloaded to behave as a normal expression of equivalent structure. Observe: asc = <|"a" -> q, "b" -> r, "c" -> s|>; Block[{q = 1, r = 2, s = 3}, asc] <|"a" -> q, "b" -> r, "c" -> s|> Also: With[{q = 1, r = ...


4

In Mathematica version 10, you can also use Inactive to allow the Symbol to be created before doing the assignment. Here is an example: Clear["x"]; Activate[Inactive[Set][Symbol["x"], 3]] (* ==> 3 *) x (* ==> 3 *)


3

Plot has attribute HoldAll, therefore the expression Fit is hold in an unevaluated form. Using Attributes@Plot (* out *) {HoldAll, Protected} reveals the attributes


3

This is a manifestation of the issue raised in this question, that Equal for packed arrays is handled in a non-standard way, causing the Listable attribute to be ignored. Range[8] returns a packed array, so for that case the non-standard evaluation kicks in. But the explicitly entered list {1, 2, 3, 4, 5, 6, 7, 8} is not a packed array, so you get the ...


3

I played around with the code and I finally found a way to do what I wanted. In the meanwhile, I think I've also better understood the behaviour of Manipulate. This is my solution; it deals with the second MWE I posted: Manipulate[ (* === Calculations that are triggered each time there is a change in tracked symbols —'parameters', in this case: ...


3

I don't know if this fits your needs, but it works for me :P DynamicModule[{a = 0, b = 0, result = {}, panel, acc, message}, Dynamic[Refresh[ Overlay[ {panel, message}, Dynamic@Switch[acc, 0, {1}, _, {1, 2}], Dynamic@Switch[acc, 0, 1, _, 2] , Alignment -> Center], None]] , Initialization :> ( acc = 0; panel = ...


3

I forwarded this question to Wolfram technical support and have received a reply. I quote the relevant part (slightly edited for clarity). The interruption of evaluation is intentionally removed [from the Evaluation menu in V10], but if you still would like to use it, you can use the keyboard combination: Option+Cmnd+.. ... filed a bug report for ...


2

Assuming expr is the integral in the question, we can manually extract any x independent terms from the differentiation as follows: expr //. RuleDelayed[ Inactive[D][Times[indep_ , rest___], x_] /; FreeQ[indep, x], indep * Inactive[D][Times[rest], x] ] - π Inactive[D][f[x] Inactive[D][f[x], x], x] On second thought, perhaps Dt is better suited ...


1

... because you forgot the round brackets: N @ (Zeta''[3/2]) 15.9896 Please research Mathematica's operator precedences



Only top voted, non community-wiki answers of a minimum length are eligible