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

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}$$


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 ...


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 ...


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 - ...


2

Let's use WReach's method to examine Manipulate: x = "global"; f[] := x Manipulate[{x, f[], Hold[x]}, {x, {"local"}}] {"local", "global", Hold[FE`x$$69]} This is akin to the output of Module. (See the WReach's post.) The value of x is not temporarily changed as with Block, nor are explicit x expressions directly replaced with the local value of x ...


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 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

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]]


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

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


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

Is this code what you wanted? Manipulate[ If[Refresh[DateList[], UpdateInterval -> 60][[4 ;; 5]] == {hour, minute}, SystemOpen["http://xianyungu.com"]]; Row[{hour, ":", minute}], {{hour, 12}, 0, 23, 1}, {{minute, 0}, 0, 59, 1}]


1

Here's the solution I ended up going with: Manipulate[ With[{f = Table[c[i], {i, n}], controls = Sequence @@ Table[{{c[i], 0}, -1, 1}, {i, n}], randomize = Hold@CompoundExpression @@ Table[Hold[c[i] = RandomReal[{-1, 1}]] /. i -> j, {j, n}]}, Manipulate[Append[f, r], controls, {{r, 0}, -1, 1}, Button["Random", ...


1

Your first example code actually is wrong, logically speaking. You are not supposed to make assignments to control variables (unless control type is set to None). The control variable is supposed to be modified only using the controls (sliders, buttons etc...), and read only in the Manipulate expression. Otherwise, you can get into an infinite loop. When ...



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