Tag Info

Hot answers tagged

12

Update: Adding a button to print a snapshot: Manipulate[Module[{a = {{2, 3}, {3, 2}}, vp}, vp = VectorPlot[a.{x, y}, {x, -4, 4}, {y, -4, 4}, VectorScale -> {0.045, 0.9, None}, VectorPoints -> 16]; z = NDSolveValue[Thread[{x'[t], y'[t], x[0], y[0]} == Join[a.{x@t, y@t}, #]], {x@t, y@t}, {t, -2, 1}] & /@ u; plot = ParametricPlot[z, ...


9

You can define a function that creates Manipulates with a "fake" SetterBar and a specific AutorunSequencing m[k_, seq_] := Manipulate[ Plot[{Sin[a*x] + b*Cos[3 a*x], k*x}, {x, 0, Pi}, ImageSize -> 400], {a, 1, 2}, {b, 0, 1}, Grid@{{"k", SetterBar[k, {0, .5, 1}]}}, AutorunSequencing -> seq, ContentSize -> {420, 270}] then create the frames ...


8

I wrote something to do something a little like what you wanted. Here I've adapted it so you can get a run through for each setting of the SetterBar. Some description of the functions. autolist[control_pattern] := list of manipulate settings for the animation specs is a pattern for culling variable specifications out of a Manipulate ...


8

Using the "almost new" feature of NDSolve[] that allows it to detect vector equations based upon the dimensions of the initial conditions. a = {{2, 3}, {3, 2}}; vp = VectorPlot[a.{x, y}, {x, -4, 4}, {y, -4, 4}, Axes -> True, AxesLabel -> {x, y}, VectorScale -> {0.045, 0.9, None}, VectorPoints -> 16]; ...


7

This is just an idea how to prepare frames to export, don't have time for more now: f = Interpolation[ { {0, {1, 0, 0}}, {1, {2, 0, 0}}, {2, {2, 1, 0}}, {2.02, {1, 0, .5}}, {3, {1, 0, .5}}, {4, {2, 0, .5}}, {5, {2, 1, .5}}, {5.02, {1, 0, 1}}, {6, {1, 0, 1}}, {7, {2, 0, 1}}, {8, {2, 1, 1}} }, InterpolationOrder -> ...


6

The export to movie is easy. (just write p=Manipulate[..] then export p to movie. Controlling the sequences as you want, I think have to be programmed in. Autorunsquences does not give one full control of all the scenario needed. Here is the Manipulate you have. It runs in 2 modes. Automode, runs pre-programmed scenario. Click again, turn this off, so you ...


6

OK, I guess I found something myself while trying to circumvent RunScheduledTask. DynamicModule[{prog = False}, Column[{ Button[ "Do heavy work", prog = True; Pause[10]; prog = False, Method -> "Queued" ], Dynamic@If[prog, ProgressIndicator[Appearance -> "Percolate"], Invisible[ProgressIndicator[Appearance ...


5

The problem is that trajectory[f] passes the Symbol f to Manipulate, so that the Manipulate updates to the new f whenever the definition of f is changed. The trick is to somehow to evaluate f so that the symbol f is replaced by its definition before it is injected into the Manipulate code. Method 1: ClearAll[soln]; soln[f0_, y0_] := Function[t0, y[t0] ...


5

I'm not sure if this is exactly what you need but this is what I've recently done to inform the user about ongoing calculation. Usage withProgressIndicator[proc, delay] Performs a proc, and when it lasts longer than delay (default 0), a progress indicator in dialog is created. It will be closed after finishing the proc. It should be run on Main Link, ...


4

With small modifications of the code provided by m_goldberg you can get the Button and the ProgressIndicator in the same Row. However, it is always there now and will not appear and disappear. DynamicModule[{n = 1}, Row[{Button["Start", n = 1; Do[Pause[0.1]; ++n, {i, 1, 100}], Method -> "Queued"], Spacer[23], Dynamic[ProgressIndicator[n, {1, ...


4

Your code can be simplified. In particular, I recommend that you get rid of the embedded DynamicModule and, instead, use a common trick of defining invisible controls to localize temporary variables. Manipulate[ s0 = 1 - i0; γ = 1/l; sol = NDSolve[{ s'[t] == -β/(E^(k (t - τ)))*s[t]*i[t], i'[t] == β/(E^(k (t - τ)))*s[t]*i[t] - γ*i[t], ...


4

Change: sol = NDSolve[ ___ ] ... By sol = First@NDSolve[ ___ ] result:


4

You can include an iterator along with the function in the mapping: k = 0; (++k; f[#]) & /@ Range[100];


3

Is this what you mean? Manipulate[ Grid[{{txt}, {idx}}], Grid[{ {"T", InputField[Dynamic[txt, {txt = #; idx = StringLength[txt]} &], String, ContinuousAction -> True]}, {"index", Manipulator[Dynamic[idx, {idx = #} &], {0, Dynamic@StringLength[txt], 1}], Dynamic[idx]} }], {{txt, ""}, None}, {{idx, 0}, None} ]


3

It seems to work if I remove the extraneous calls to Dynamic. Manipulate[ {p[[#]] & /@ Range[5], Select[p[[#]] & /@ Range[5], (#[[1]] != #[[2]]) &]} // TableForm, {p, None}, {{np, "", "Test"}, Column[{Dynamic[sP /@ Range[5] // Row, TrackedSymbols :> {np}]}] &}, Initialization :> ( np = 5; sP[i_] := ...


3

Column[{Panel["Panel 1"], Panel["Panel 2"], Mouseover[Panel["Panel 3"], Column@{Panel["Panel 3"], Panel["Extra Panel"]}], Panel["Panel 4"]}, Spacings -> {0, 0}] Or Column[{Panel["Panel 1"], Panel["Panel 2"], Dynamic@If[CurrentValue["MouseOver"], Column@{Panel["Panel 3"], Panel["Extra Panel"]}, Panel["Panel 3"]], Panel["Panel 4"]}, ...


3

You can do this: Manipulate[Evaluate@Sin[Slot[n]] &[0, Pi/2], {{n, 1}, Range[2]}] but I don't think it is as handy as: Manipulate[Sin[{0, Pi/2}[[n]]], {{n, 1}, Range[2]}]


3

You can just use AppendTo, I added a Pause since it happens so fast otherwise vals = {}; Dynamic[ListPlot[vals]] FindMinimum[x1^4, {x1}, StepMonitor :> (AppendTo[vals, x1]; Pause[.5])]


3

A simple solution would be to wrap those expressions into a DynamicModule: DynamicModule[{vp, vv} , {vp, vv} = Options[Graphics3D, {ViewPoint, ViewVertical}][[All, 2]] ; { Graphics3D[Cuboid[], ViewPoint->Dynamic[vp], ViewVertical->Dynamic[vv]] , Graphics3D[Cuboid[], ViewPoint->Dynamic[vp], ViewVertical->Dynamic[vv]] } // GraphicsRow ] ...


3

I find answer in Help system! It's necessary to write a = DynamicSetting[Checkbox[]] and evaluate it in place by Cntrl+Shft+Enter. That`s all!


3

You are looking for this: {InputField[Dynamic[x], Hold[Expression]], Dynamic[ReleaseHold[x]]}


3

The closest I can get to what you ask for is DynamicModule[{n}, Button["Start", n = 0; Monitor[Do[Pause[0.1]; ++n, {i, 1, 100}], Dynamic[ProgressIndicator[n, {1, 100}]]], Method -> "Queued"]] which, after the button is clicked on, produces The progress indicator appears in its own temporary cell, not in a row with the button. ...


2

This can be done with Clock. The following will import foo.json every 5 seconds. With[{update = 5}, Dynamic[{foo = Import["~/Desktop/foo.json"], Clock[{1, update, update}, update]}]]


2

A simple workaround is to use Part and SlotSequence like this: ColorData[col][{##}[[n]]] Another workaround is to generate the function that is applied (@@@) with another function: pointslf[1] = RandomReal[1, {12, 7}]; Manipulate[DynamicModule[{min, max, col, fn}, {min, max} = Through@{Min, Max}@pointslf[1][[All, n]]; col = {"TemperatureMap", {min, ...


2

I observe no problem here: make[] := Manipulate[x^2, {x, 1, 5}] PasteButton["A dynamic object", make[]] // CreatePalette Perhaps you forgot to localize your variables with DynamicModule which Manipulate makes use of automatically?


1

I agree with Rojo's comments under his answer and I'd upvote them but the example from tutorials given in his answer is more confusing than educational for me (as expressed in comments). "For me", not "in my opinion" so maybe one can learn more from this part of tutorial. Nevertheless, I want to show you examples were using Refresh really matters. Refresh ...


1

Manipulate version. Manipulate[ Row@string , Column[{Dynamic[pop /@ Range[n] // Row, TrackedSymbols :> {n}], SetterBar[ Dynamic[x, If[# === "+", n++; string = Join[string, {"a"}], n--; string = Most@string] &], {"+", "-"}]}] , {x, None}, {n, None}, {string, None} , Initialization :> ( pop[i_] := With[{j = ...


1

I haven't tested this with data, perhaps you can post some example data. I've assumed the lists of data you import are all numbers. If you are unsure then you would need additional tests on the imported data before doing the calculation (see MatrixQ, VectorQ and their 2nd arguments). Also I suspect that PopupWindow would be a better choice than ...


1

I think you are working too hard. If you just want to put a plot below your input fields, you can do it like this. asq[a_] := a*a DynamicModule[{a = 2}, Style[ Panel[Dynamic @ Column[{ Grid[{ {Style["Input number", Blue], InputField[Dynamic[a], Number]}, {Style["Square of number", Red], ...


1

I reported a problem with Opener and Appearance option, this is the reply: [CASE:2678632] Feedback [...] There is an 'Appearance' issue on the Windows platform and it has been reported already. [...] So I believe it is a subject to change. As a temp. replacement: opF = Opener@False~Rasterize~(ImageSize -> 12); opT = ...



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