Tag Info

Hot answers tagged

7

Here's a walkaround: Manipulate[ x, Row @ List @ EventHandler[ Checkbox[Dynamic[x]], {"MouseDown" :> (x = True), "MouseUp" :> (x = False)}] ]


5

Why do you think the result is obviously wrong? expr1 = (a + b t) Cos[n t]; int1 = Integrate[expr1, {t, t1, t2}] (1/(n^2))(-b Cos[n t1] + b Cos[n t2] + n (-(a + b t1) Sin[n t1] + (a + b t2) Sin[n t2])) The indefinite integral is int2 = Integrate[expr1, t] // Simplify (b Cos[n t] + n (a + b t) Sin[n t])/n^2 Calculating the definite ...


4

xp[t_, r_, t0_, x0_] := x[t] /. First[ NDSolve[{x'[t] + r x[t] == 0, x[t0] == x0}, x[t], {t, 0, 10}]]; Manipulate[ ClickPane[ Plot[g, {t, 0, 10}, PlotRange -> 1, Frame -> True, Epilog -> {PointSize[Large], Point[sp]}], (AppendTo[g, xp[t, r, #[[1]], #[[2]]]]; {t0, x0} = #; AppendTo[sp, #]) &], {{r, 1, "r"}, -10, 10, 0.01, ...


4

It's much simpler f[g1_Graph] := DynamicModule[{pts = PropertyValue[{g1, #}, VertexCoordinates] & /@ VertexList@g1, g2 = g1}, {Dynamic@Column@pts, LocatorPane[Dynamic[pts], Dynamic[g2 = SetProperty[g2, VertexCoordinates -> pts]]]}] g = CompleteGraph[5, VertexLabels -> "Name", PlotRange -> {{-5, 5}, {-5, 5}}]; f@g


4

You can try something like: RemoveScheduledTask @ ScheduledTasks[]; RunScheduledTask[c = Round[ControllerState["Y Axis"], .1], .1] Dynamic[{RandomReal[], c}] (*RandomReal tells us when c triggers updating*) Plot[{Sin[x]}, {x, 0, 2}, GridLines -> Dynamic[{{1}, {c}}]] So the Dynamic is not triggered by controller itself but by the value of it. It will ...


4

Add PlotRange -> {{-2, 2}, {-2, 2}, {-2, 2}} to your Graphics3D


4

Since $\frac{1}{2}>\frac{1}{3}$, the increment is negative, and you get $$\frac{1}{2}-\frac{1}{144}=\frac{71}{144}$$


3

I'm no Manipulate master, but from previous nasty experiences, I have a few tips: Read the related tutorials, not only the direct documentation. They explain a great deal of the internal "mechanics", and have some examples that make for some great A-ha moments. - https://reference.wolfram.com/language/tutorial/IntroductionToDynamic.html - ...


3

Let me add a simple explanation of one of your concerns. Without those context references. Also, I don't think that FE's and Kernel's ownership of variables matters here. According to the first section of AdvancedManipulateFunctionality: The subject of when exactly a given dynamic expression will be updated is complex, and is addressed in "Introduction ...


2

In the mean time fortunately I started understanding the background of the problem in question 63982. I added another answer there, essentially stating that as soon as the second argument of the button does not contain the symbol c, the construction will work. The solution of @belisarius satisfies this condition. So in the sequel I will not discuss any more ...


2

There are two syntaxes for DSolve: In[5]:= DSolve[x''[t] + x[t] == 0, x, t] Out[5]= {{x -> Function[{t}, C[1] Cos[t] + C[2] Sin[t]]}} In[6]:= DSolve[x''[t] + x[t] == 0, x[t], t] Out[6]= {{x[t] -> C[1] Cos[t] + C[2] Sin[t]}} Notice that one returns the solution for x, the other for x[t]. Both are meant to be substituted into x[t], and will give the ...


2

Another solution (make a matrix of elements Aij[t] and substitute the functions you have found): sol = {A11 -> Function[{t}, expression1], A12 -> Function[{t}, expression2], A21 -> Function[{t}, expression3], A22 -> Function[{t}, expression4]}; Partition[Through[{A11, A12, A21, A22} [t]], 2] /. sol (* {{expression1, expression2}, ...


2

If you use MMA 10 try DSolveValue instead of DSolve. In this case may help this: (*extracting expressions from Function*) t = Solution /. func_Function :> func[[2]]; (*extracting expressions from Rule*) t /. rule_Rule -> rule[[2]]


2

There were several errors in your Manipulate variable specification: "Days" outside of the DateRange function brackets "Days" instead of "Day" {} around DateRange: this function generates a list itself, nothing else is needed. SaveDefinition option within the date specification list, instead of as an option of Manipulate Furthermore, you have your dates ...


2

You can use a list of points instead of individual controls and Manipulate will construct a LocatorPane to handle them. Not fussing much with the rest of the code, except to eliminate the global variables gr5 and coords: Manipulate[ With[{gr5 = Graph[el0, EdgeStyle -> LightGray, VertexCoordinates -> v, VertexLabels -> "Name", ImageSize ...


1

Manipulate[ ClickPane[Plot[g, {t, 0, 10}, PlotRange -> x, Frame -> True], (AppendTo[g, Exp[-(t - #[[1]])]*#[[2]]]) &], {x, 1, 10}, Initialization :> {g = {}}]


1

I don't know how to fix it, but the issue seems to be with wrapping Dynamic around any kind of CurrentValue information: u = 0; Dynamic[Refresh[u++, TrackedSymbols :> {}, UpdateInterval -> 1]] (* Correctly updates: 1....2....3.. *) Dynamic[Refresh[ControllerState[4, "X1"], TrackedSymbols :> {}, UpdateInterval -> 1]] Dynamic[ControllerState[4, ...


1

Manipulate[Plot[Sin[a x], {x, -2 Pi, 2 Pi}, PlotLabel -> Row[{"a=", a}]], {a, 0, 5}] For exporting, there are many posts on exporting Manipulate to animations/movies. Please see this for example Export animation of a Manipulate autorun sequence? If the above still does not answer you, then you can follow up. ps. You can always just export like this ...


1

Perhaps Manipulate[ParametricPlot[{t-x, a/t^2*(t - x)^2 + b/t*(t - x) + c}, {t, 1, 100}, AspectRatio -> 1, Frame -> True, PlotRange -> {{-100, 100}, {-5, 20}}, FrameLabel -> {"t-x", "Func"}], {x, 1, 100, 1}, Delimiter, {a, 0, 10}, {b, 0, 10}, {c, 0, 10}] or, Manipulate[Plot[a/(w + x)^2*(w)^2 + b/(w + x)*(w) + c, {w, -100, 100}, ...


1

ClearAll[t]; {#[[0]], #[[1]], #[[2]]} &@Function[{t}, expression1 t] //Column (* Function {t} expression1 t *)



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