# Tag Info

1

Here's my attempt at achieving what you describes. 1) I define a display function that takes n as the number of randomly generated locators (initLoc). It also takes a list of speeds v between those locators. The rest of the function is figuring out at what time a particle will reach a particular locator (locatorTimes) given its average speed and the locator ...

6

I got an answer from Wolfram Technical Support today. They had the following to say so far: "...It does appear that Manipulate is not behaving properly, and I have forwarded an incident report to our developers with the information you provided. [...] We hope this will be resolved in our future release of Mathematica."

4

This can be done more cleanly by localizing curve to the manipulate, which in turn is done by making curve an invisible control. This also obviates the need for the Initialization option, because controls take optional initializers. Manipulate[ Graphics[{ {Red, PointSize @ .02, Point@pt}, Line @ AppendTo[curve, pt]}, Axes -> True, ...

2

Replacing the Set in Initialization by a SetDelayed solved the problem, TrackedSymbols should be set also. Conjecture: It seems Clear before Manipulate produces problems, I can't believe it. It can be used in a separate cell, but not in the same cell. Experiences? Manipulate[ curve = Append[curve, pt]; Graphics[{{Red, PointSize@.02, Point@pt}, ...

1

There are lots of ways to do what you want. I would not use Module. Here are three, all of which use methods other than Module to localize variables: SeedRandom @ 42; With[{rand = RandomInteger[10, {5, 5, 2}]}, Manipulate[ ListPlot[rand[[i]], PlotRange -> {{-1, 11}, {-1, 11}}], {i, 1, Length[rand], 1, Appearance -> "Labeled"}]] SeedRandom @ ...

1

if you need to keep the definition of l inside manipulate, I think you can try this Manipulate[l = RandomInteger[10, {3, 5, 2}]; ListPlot[l[[i]], PlotRange -> {{-1, 11}, {-1, 11}}], {i, 1, Dynamic@Length@l, 1}] you need to know that for every i, l will be computed again and again. if you want to do 3 plot per each l then you can do it like this ...

1

A memory consumption demonstration Manipulate[{Plot3D[Sin[x a] - Cos[y], {x, -10, 10}, {y, -10, 10}, ColorFunction -> "TemperatureMap", PlotRange -> 11], MemoryInUse[]} // Column, {a, -2, 2, 0.1, Appearance -> "Open"}, TrackedSymbols :> a] After testing this code you should restart MMA, to guarantee full memory available.

4

Update: same thing happens in versions 8.0.4 and 9.0.1. I'm on OS X 10.9.4, Mathematica 10.0.0. I did not wait for 10 minutes, but I do notice that the memory usage of the front end process (Mathematica) is increasing without bound. After a relatively short time it has reached 1.5 GB, so in 4 minutes it is certain to exceed 16 GB. This might be the ...

2

Here is what I understood, I might be mistaken because it's quite unclear to me. Module[{source, target, weight, tree, g}, source = {"aaa", "aaa", "BBB", "ccc", "ddd", "aaa", "aaa", "aaa", "aaa", "aaa"}; target = {"ddd", "eee", "aaa", "aaa", "aaa", "fff", "ggg", "hhh", "iii", "jjj"}; weight = {4.8, 4.4, 4.2, 4.1, 3.6, 3.3, 3.2, 3, 2.7, 2.6}; tree = ...

13

The separation-of-variables solution you quoted has two indices appearing in it: n and j (the subscripts of the coefficient $A_{nj}$). Here, n is azimuthal mode order, i.e. it counts the number of nodes along the direction in which the polar-angle $\theta$ varies (divided by 2). The index j is needed because the wave is supposed to satisfy the boundary ...

7

Your code is redefining the function f every time the Manipulate updates its contents pane, which causing Mathematica to go hyper. You should use the option Initialization so the function is defined just once. Manipulate[ Column @ {Plot[f[x], {x, 0, a}], f[a]}, {a, 1, 50}, Initialization :> (f[x_] = Sin[x])]

2

It seems the definition of f inside the Manipulate is causing the problem (I'm not sure on the exact details, perhaps someone else can elaborate). Besides eldo's solution with TrackedSymbols, you might opt to define f outside: f[x_] := Sin[x] Manipulate[{Plot[f[x], {x, 0, a}], f[a]}, {a, 1, 50}] But why define f at all? It can also be done without ...

4

Manipulate[f[x_] := Sin[x]; {Plot[f[x], {x, 0, a}], f[a]}, {a, 1, 50}, TrackedSymbols :> {a}] solved the problem for me (I got the same flickering). The Documentation doesn't say too much about TrackedSymbols. In your case not only a but also x is continiously updateted. But Manipulate should update x only in case a changes, i.e., the slider is moved. ...

1

The example below shows the effects of forcing a unitary step size in the manipulator in the application you created. The table is filled as expected but there is an uncomfortable lag in the manipulator. I created this example to support the following statements. I think that Manipulator really doesn't need a new option but that programmers need to adjust ...

2

In Mathematica 10 there is a new way to constrain locators that is short and simple. First define your region: circles = Table[Circle[{0, 0}, r], {r, 1, 15, 2}]; lines = Table[Line[{{-15 Cos[the], -15 Sin[the]}, {15 Cos[the], 15 Sin[the]}}], {the, 0, Pi, Pi/6}]; grid = RegionUnion[circles, lines]; And then use the second argument of Dynamic like in ...

2

Another way using the built-in coordinate transforms : define a rule to perform the transformation : rule = Rule[x^2 + y^2 + z^2, Simplify[TransformedField["Cartesian" -> "Spherical", x^2 + y^2 + z^2, {x, y, z} -> {\[Rho], \[Theta], \[Phi]}], Assumptions -> {\[Rho] > 0}]] expr = D[D[E^(I (-k r ...

2

Use rules to do both the forwards and the backwards substitutions. Step 1: deriv = D[D[E^(I*((-k)*r + t \[Omega]))/r /. r -> Sqrt[x^2 + y^2 + z^2], x], y] Step 2: PowerExpand[deriv /. {x^2 + y^2 + z^2 -> r^2}]

4

This will produce a simplified form: Simplify[ D[D[E^(I (-k r + t \[Omega]))/r, x], y] /. Power[x^2 + y^2 + z^2, n_] :> Power[HoldForm[r], 2 n]]

Top 50 recent answers are included