New answers tagged

2

What about: StoppingTest -> (Apply[ Or, Table[EuclideanDistance[Coordinates[s], Source[i]] < 1, {i,1,NumSources}], {0}])


1

If there is a need to preserve initial structure of the code, some condition may be an option: Manipulate[ dom = {-10, 10}; If[Not[NumericQ[f]] || Not[Between[f, dom]], f = 0]; Plot[a Sin[2 Pi f t/12], {t, 0, 12}, PlotRange -> {{0, 12}, {-1, 1}}, AspectRatio -> 0.5, Frame -> True, Axes -> True, ImageSize -> 800], Row[{ ...


1

You can avoid trouble by choosing reasonable values for the range and increment of your controls. The following choices work well. Manipulate[ Plot[a Sin[2 Pi f t/12], {t, 0, 12}, PlotRange -> {{0, 12}, {-1, 1}}, AspectRatio -> 0.5, Frame -> True, ImageSize -> 700], Row[{ Control[{{f, 1, "frequency"}, 0, 10, 0.01, ...


1

To address the issue use some Off[NumberForm::sigz] in Manipulate[...]. It is also better to use simple Epilog with Text[Row[...] (code below): Some code picture:


1

The simplest way I thick is to use Dynamic["your function"] instated of 1 in your controller. Control[{{A, 0.1, "Amplitude"}, 0, Dynamic["your function"], 0.01, Appearance -> {"Labeled", "Closed"}}] I think this will give you want you want, (assuming the function of the end is f+1): Manipulate[ Plot[A Sin[2 Pi f t/12], {t, 0, 12}, PlotRange -> ...


2

I just want to point out the Edmund's fancy version of Manipulate is unnecessarily complicated. The same effects can be gotten with much simpler code. Manipulate[ Plot[Sin[a + b x], {x, 0, 10}], Row[{ Control[{{a, 0, ""}, {0, 1}}], " ", Dynamic @ Switch[a, 0, "Zero", 1, "One"]}], {{b, 1, ""}, 1, 5, Appearance -> "Labeled"}] ...


4

A simple way is to define your Manipulate variable parameters so that they are recognised as the control type you want. Look in the first part of the Details and Options section of Manipulate documentation. Manipulate[ Plot[Sin[a + b x], {x, 0, 10}], {{a, 0}, {0, 1}}, {b, 1, 5}] You can get fancier by specifying the controls and layout directly. ...


3

EDIT: added use of PlotLegends package Use a single Plot with the option Filling Needs["PlotLegends`"]; EffPot[r_, Energy_, AngMom_] := -Energy/r + (AngMom^2 - 1)/(2 r^2) Manipulate[ Plot[{ EffPot[r, Energy, AngMom], (Energy^2 - 1)/2}, {r, 0, 10}, PlotStyle -> { {Thick, RGBColor[0.60, 0.20, 0.40]}, {Thick, RGBColor[0.20, 0.20, ...


15

ColorFunction and Epilog were around in version 7. However, ColorFunction did get an update in version 9 so I am not certain if this will work in version 7. Animate[ ParametricPlot[circle[t], {t, Max[0, u - .2], u}, PlotRange -> {{-dMax, dMax}, {-dMax, dMax}}, ColorFunction -> Function[{x, y, w}, Opacity[w, Blue]], Frame -> True, Axes ...



Top 50 recent answers are included