Tag Info

New answers tagged

1

This is now my final Code (V10.02). Thanks a lot for the help m_goldberg ! Manipulate[ Plot[Evaluate[checkBoxes/.{ 1-> 1,2-> Log[n],3-> n,4-> Log[n]n,5-> n^2}],{n,0,d}, PlotLabel->TableForm[{{"Funktion","Value"}, Sequence@@DeleteCases[MapThread[If[#1,#2,Null]&, {MatchQ[Alternatives@@checkBoxes]/@Range[5], ...


7

Here is a rework of your code that I think produces what you are asking for. One issue I have not addressed is plot filling because I think it a bad idea with so many functions on the plot. I also made some minor changes to the control layout to get a more compact display. You can easily restore your original layout if you like. Manipulate[ Column[ ...


2

Manipulate[{ m = {{a, b}, {c, d}}; Column[{r = Thread[m.{x, y} == {f, g}], s = LinearSolve[m, {f, g}]}], ContourPlot[Evaluate@r, {x, -5, 5}, {y, -5, 5}, PlotLabel -> s]}, {{b, 3}, 0, 3}]


2

Expanding on Kuba's answers, if you use Dynamic for both controls I believe you can fully accomplish your goal. When you set filter it will both gray out the elements less than the filter in list and if the element in list is less than the filter it will reset it to the filter value. Manipulate[ {filter, list}, (* Manipulate Controls *) {{filter, 1}, ...


2

Perhaps: f[aa_, oo_, pp_] := CreateDialog[ Column[{Manipulate[ Plot[(aa = amp) Sin[(oo = omega) t - (pp = phi)], {t, 0, 10}], {amp, 0, 1}, {omega, 1, 10}, {phi, 0, 2 Pi}], DefaultButton["Close", DialogReturn[]]}], Modal -> True]; Dynamic[{a, o, p}] f[Unevaluated@a, Unevaluated@o, Unevaluated@p]


2

Another approach slightly different from LLIAMnYP's answer to is to go ahead and treat the x and y variables as local to Manipulate. In this approach x and y are updated dynamically and used to compute the intermediate results, q and w. x and y are used to directly compute f but the intermediate results are used to compute z. One uses DyanmicModule to ...


2

The problem here is scoping. x and y inside the Manipulate are not the same x and y that you use globally. In order to remedy this, use the option LocalizeVariables -> False. Manipulate[{q = 2 x, w = 3 y}, {x, 0, 10}, {y, 0, 10}, LocalizeVariables -> False] (* slide around *) x (* 3.74 *) z = 4 q + 5 w f = 3 x + 4 y (* 103.72 *) (* 30.9 *) Perhaps a ...


1

I've not answered any questions with this example, but I added tmin, tmax, xmin, xmax, and adjusted when to halt the integration. I don't know yet how to handle the Check command in MichaelE2's comment, so that still remains in the code. Manipulate[ClickPane[Show[Plot[g, {t, tmin, tmax}, PlotRange -> {{tmin, tmax}, {xmin, xmax}}, Frame -> ...


3

There are couple of ways to handle your problem. Simple -- give a warning of slider interference: Manipulate[ If[t1 < t2, Plot[t^2, {t, t1, t2}], "Warning: t1 > t2"], {{t1, -1}, -2, 2, 0.1, Appearance -> "Labeled"}, {{t2, 1}, -2, 2, 0.1, Appearance -> "Labeled"}] More elegant user interface, less elegant code -- prevent slider ...


2

data = FinancialData["IBM", "Jan. 1, 2014"]; Manipulate[ Block[ {x = DatePlus[data[[1, 1]], t]}, DateListPlot[ data , Epilog -> Line[ { {x, Min@data[[All, 2]]} , {x, Max@data[[All, 2]]} }] ] ], {t, 0, QuantityMagnitude@ DateDifference[First@First@data, First@Last@data]}]


4

Re NDSolve::ndsz: Using WhenEvent, one can stop the integration before the solution reaches an infinite singularity, which is what is happening with the example differential equation. I removed the Quiet so one might test it. If the differential equation is changed, then it would be possible to get the message to appear. Use Quiet to suppress it, Check to ...


2

The following turns off the warning messages, but is not really a good solution, since it doesn't deal with the root problem of the trouble NDSolve is having with your differential equation. sf[eq_, A_, B_] := VectorPlot[{1, eq /. {a -> A, b -> B}}, {t, -2, 2}, {x, -2, 2}, VectorPoints -> 17, VectorScale -> {0.03, Automatic, None}, ...


3

I think your Quiet is not in the right place, and you may need another one. For f: f[t_, a_, b_, t0_, x0_] := Quiet[u[t] /. First[NDSolve[{u'[t] == ODE, u[t0] == x0}, u, {t, -2, 2}, Method -> "StiffnessSwitching"]]]; gets rid of the NDSolve warning. Then add another Quiet around the Plot: Quiet[Plot[g, {t, -2, 2}, PlotRange -> 2, ...


0

The principal question seems to be how to format matrix input in matrix form. The rest is not explained clearly enough for me to address and seems extraneous. The OP's approach: Manipulate[value[a, b, c, d, e, f, g, h, i], Style["Matrix values", 12, Bold], Grid[{ {Control@{{a, 0}, InputField, ImageSize -> Small}, Control@{{b, 0}, InputField, ...


1

Here's how I would do it: Manipulate[ Plot[f[x], {x, a, b}, PlotStyle -> Thick, AxesLabel -> {"x", "y"}, Epilog -> Dynamic@{Table[{Opacity[0.05], EdgeForm[Gray], Rectangle[{a + i dx[n], 0}, {a + (i + 1) dx[n], f[a + (i + 1) dx[n]]}]}, {i, 0, n - 1, 1}], Text["N = " <> ToString[n] <> ", R = " <> ...


1

The use of ExportString and/or ImportString, which in fact just use Export and Import on temporary files, seems to trigger dynamic updates. Front-End options get changed and perhaps some variables, and it must be that some of these are tracked. It's difficult to know whether they ought to be or not. In any case, a side effect is the continual updating of ...


3

ControlActive doesn't respond to SetterBar, as changing a value using SetterBar doesn't make $ControlActiveSetting being True. Here is one way to make using the SetterBar reset k: Manipulate[ Row[{x, Spacer[10], y, Spacer[10], ControlActive[k = 0, k++], Spacer[10], $ControlActiveSetting}], {x, {5, 6, 7, 8}, ControlType -> SetterBar, ...


2

DynamicWrapper is a way to introduce such a dynamically updated animation. In the code below, the animation is not started until the user lets go of the control (via $ControlActiveSetting). Manipulate[ Graphics[ DynamicWrapper[ {FaceForm[Opacity[0.6, Green]], Rectangle[{0, 0}, {0.5, vLIQ}], EdgeForm[Thick], FaceForm[None], Rectangle[{0, 0}, ...


0

I can't run your code, so I can't offer you a working modification to your code, but only offer advice. Popup menus can't be specified in the way you have tried to do it. Here is an example of a demonstration with a popup menu specified in the conventional way (which is simple). I hope you can adapt it to your needs. With[{maxK = 3}, With[{lbls = ...


6

Body of Manipulate is wrapped by Dynamic and Dynamic doesn't know what's inside inner Dynamics, that's how we can screen a variable to not prompt the very outer Dynamic to evaluate: Manipulate[ e = RandomVariate[NormalDistribution[0, sigma], n]; {Dynamic@a, e}, {{n, 3}, 1, 5, 1, Appearance -> "Labeled"}, {{sigma, 1}, 1, 2, Appearance -> ...



Top 50 recent answers are included