When we do a StreamPlot
, I want to show the bifurcation when a=0 transitions to a>0, but do not see a better way to do this than the following.
Animate[StreamPlot[{1,-x^4 + 5 a x^2-4 a^2}, {y,-5,5}, {x,-4,4},
PlotLabel -> Row[{"a = ", a}]], {a,-1,1}]
Is there a better way to show this bifurcation?
Maybe an animated gif like this Bifurcation diagrams for multiple equation systems) (this is a system and my example is not a system)?
Update
To be more clear, the original system is
x′(y)=−(x(y))4+5a(x(y))2−4a2
Answer
Since you have just two variables, x and a, you can make a 2D plot:
f[x_, a_] := -x^4 + 5 a x^2 - 4 a^2;
Show[StreamPlot[{f[x, a], 0}, {x, -4, 4}, {a, -1, 1}, StreamPoints -> Fine],
ContourPlot[f[x, a] == 0, {x, -4, 4}, {a, -1, 1}, ContourStyle -> ColorData[1, 2]]]
My explanatory comment below was incorrect, so I'm including a corrected version here. The parameter a is on the vertical axis. For a=1 we have four equilibrium points. These are visible as intersections of the red curve with the slice a=1 parallel to the horizontal axis. Note that if you have x′=fa(x)=−x4+5ax2−4a2 with a=1, then for |x|>2 you have x′<0, for 2<|x|<1 you have x′>0, and for |x|<1 you have x′<0, all of which are visible in the diagram in terms of the direction of the arrows.
Nevertheless, the version in Mark's answer is much more beautiful.
Comments
Post a Comment