New answers tagged

2

I would use DyanmicModule to give better localization. I would also put as many plotting options as possible into Show to reduce code repetition. DynamicModule[{pa, pb, pc, A, δ, σ}, pa[A_, δ_, σ_] := Plot[Max[(1 + β)/(2 β), (1 + β)^2/(2 β) (1/σ (β/(1 + β) A - δ))], {β, 0, 4}, Filling -> {1 -> Top}, FillingStyle -> LightBlue]; ...


0

Define plotting functions outside Manipulate: g1[k_] := Plot[Sin[k x], {x, 0, 2 Pi}]; g2[k_] := Plot[Cos[k x], {x, 0, 2 Pi}]; g3[k_] := Show[g1[k], g2[k]]; Manipulate[g3[k], {k, 1, 10, 1}]


2

Move all of your plot definitions inside the Manipulate Manipulate[ pa = Plot[ Max[(1 + β)/(2 β), (1 + β)^2/(2 β) (1/\ σ (β/(1 + β) A - δ))], {β, 0, 4}, Filling -> {1 -> Top}, FillingStyle -> LightBlue, PlotStyle -> Opacity[0.5], AxesLabel -> {"β", "ξ"}, PlotRange -> {{0, 4}, {0, 1.5}}]; pb = Plot[ Min[(1 + β)/(2 β), (1 ...


0

PaneSelector[{1 -> Control[{{maxrange, 5}, 1, 10}], 3->Control[{{maxrange, 15}, 10, 20}]}, Dynamic[tab /. 2 -> 1]] or PaneSelector[{## & @@ Thread[{1, 2} -> Control[{{maxrange, 5}, 1, 10}]], 3 -> Control[{{maxrange, 15}, 10, 20}]}, Dynamic@tab]


1

$Version (* "10.4.1 for Mac OS X x86 (64-bit) (April 11, 2016)" *) For a control with a small number of discrete values, a ControlType of either SetterBar or PopupMenu may be a better choice than a Slider. The following enables selection of each control type for comparison. The controls do not need to be all of the same type. You can mix and match to ...


3

Manipulate[ Plot[F*(1 - Exp[-K (A - S)]), {A, 0, 100}, PlotRange -> {0, 50}], {S, 1, 5, 1}, {F, 40, 50, 1}, {K, .5, .5, .5}]


1

I am not confident that the restrictions p > 0 && c > p && ((0 < l < p/(2 c) && 0 < s < (-2 c + p)/(4 c l - 2 p)) || (p/(2 c) <= l <= 1 && s > 0)) will ensure that the two functions will intersect. However to answer the question about how to implement these restrictions in ...


2

Analysis Key step is to solve for wi1, wi2, wj1 and wj2 symbolically in terms of the input points l1, l2, p1, p2 and p3. The symbolic solution will be used in the Manipulate which will dramatically speed up the process. Below is the code, some are a direct copy, others have changes. At[X_] := 1/2 Det[({{1, X[[1, 1]], X[[1, 2]]}, {1, X[[2, 1]], X[[2, ...


1

Disable "Show Suggestions Bar after last output" and be sure "Dynamic Updating Enabled". Now you can run the Manipulate and it works fine on Windows 10 (64 bit) and Mathematica 10.4.1. Manipulate[Plot[Erfc[x/(2 Sqrt[t])], {x, -5, 5}], {t, 0.1, 5}]


2

Bug was fixed in version 10.4.0.0.


0

I could resolve the CloudObject problem by restarting the mathkernel and export the Manipulate-element once again. The problem with the missing approximation curve can be solved by not defining the function ser[] outside of Manipulate[]. However, concerning the latter, I have no idea why no error message is returned.


4

You have to change your For loop to account for positive and negative regions, and make the box twice as big. First change the definition of A, A = 2 fmax*L; Then modify your For loop to be posinboxcount = 0; neginboxcount = 0; countmissed = 0; For[i = 1, i <= totalcountmax, i++, xrand = RandomReal[{xinit, xlast}]; yrand = RandomReal[{-fmax, ...


4

Others have explained why the version with rl does not work. But this does not explain the very weird phenomenon that the version with % does work. Why is % (which is just a notation for Out) special? It seems that Manipulate singles out Out (i.e. %) for special treatment. Observe: In[1]:= x Out[1]= x In[2]:= Manipulate[Hold[%1], {x, 0, 1}] Out[2]= ...


0

Perhaps you would like to use Histogram3D Manipulate[ Histogram3D[ Table[{Frequency[k, r, fmin, fmax], Amplitude[k, r]}, {k, 0, Nwaves - 1}]], {{Nwaves, 1, Style["Number of waves", 10]}, 1, 50, 1, ImageSize -> Large, Appearance -> {"Labeled", "Closed"}}, {{fmin, 0, Style["Min frequency", 10]}, 0, fmax, 0.001, ImageSize -> Large, Appearance ...


4

Thanks to ciao's and Kuba's explanation, I have thought of some little code to exemplify the scoping behaviour of Manipulate; I hope it will be helpful to people who are still not very familiar with the concept: a), Manipulate[Hold@x, {x,0,1}] b), p=x; Manipulate[2 p-x,{x,0,1}] c), rpl=q->x; Manipulate[(2 q/.rpl)-x,{x,0,1}]


6

This version works: rl = {ρ[z_, ϕ_] :> 1/5 Sqrt[25 - 25 z^2 + 10 Sin[5 ϕ] + Sin[5 ϕ]^2]}; Manipulate[PolarPlot[Evaluate[ReplaceAll[ρ[z, ϕ], %]], {ϕ,0, 2 Pi}], {z, -1, 1}] Manipulate[PolarPlot[Evaluate[ReplaceAll[ρ[z, ϕ], rl]], {ϕ,0, 2 Pi}], {z, -1, 1}] The main change is in the way the rule is defined as a $RuleDelayed$ instead of $Rule$.


2

I am posting the answer based on taking the phrase "the example is without importance" on face value (i.e. not a homework or similar). I am not exactly I understand the aim. So, with these caveats and to motivate clarification: f[a_, b_, x_, y_] := {a, b}.{x^2, y^2} /; a + b > 0 f[a_, b_, x_, y_] := Null Manipulate[ Column[{ Row[{"a+b= ", a + b}, ...



Top 50 recent answers are included