Using 3-Dimensional Bifurcation Diagrams to Enhance Student Learning

Itai Seggev
Knox College

Joint Mathematics Meeting
January 8, 2009
Washington, D.C.

What is a bifurcation?

Bifurcation

Bifurcation: a small change in a parameter in an ODE qualitatively changes the structure of solutions.

y'=f (y;c)

y: dependent variable

y'=((dy)/(dt)): first derivative

c: a free parameter

Saddle-Node Bifurcation

Manipulate[Quiet[Plot[Evaluate[y[x]/.If[ c> ((-1)/4),Join[Table[NDSolve[{y'[x]==y[x](1-y[x])+c,y[0]==y0}, y[x], {x, 0,5}], {y0, -0.5,((1-(Sqrt[1+4c]))/2), ((2-(Sqrt[1+4c]))/8)}],Table[NDSolve[{y'[x]==y[x](1-y[x])+c,y[0]==y0}, y[x], {x, 0,5}], {y0,((1-(Sqrt[1+4c]))/2), ((1+(Sqrt[1+4c]))/2), ((Sqrt[1+4c])/4)}], Table[NDSolve[{y'[x]==y[x](1-y[x])+c,y[0]==y0}, y[x], {x, 0,5}], {y0, ((1+(Sqrt[1+4c]))/2),1.5,( ((2-(Sqrt[1+4c]))/8))}]], Table[NDSolve[{y'[x]==y[x](1-y[x])+c,y[0]==y0}, y[x], {x, 0,5}], {y0, -0.5, 1.5, 0.25}]]],{x, 0,5},PlotRange->{-0.5,1.5}, PlotStyle->Thick, RegionFunction->(-.5 ≤ #2 ≤1.5&),PlotLabel->Style["\!\(\*Cell[TextData[Cell[BoxData[
FormBox[
RowBox[{
RowBox[{"y", "'"}], "=", 
RowBox[{
RowBox[{"y", "(", 
RowBox[{"1", "-", "y"}], ")"}], "+", "c"}]}], TraditionalForm]]]]]\)",FontSize->18],ImageSize->Large]], {{c,0},((-3)/4),(3/4)-(10^(-9)), Appearance->"Labeled"}, LabelStyle->Medium]

A saddle-node bifurcation is a bifurcation in which two equilibria "annihilate." In other words, a repellor and attractor merge, resulting in the number of equilibria reduced by two.

Pitchfork Bifurcation

Manipulate[Plot[ Evaluate[ y[x] /. If[c > 0,Join[Table[NDSolve[{y'[x]==y[x](c-((y[x])^2)),y[0]==y0},  y[x], {x, 0,5}],{y0, -2,-(Sqrt[c]), ((2-(Sqrt[c]))/4)}],Table[NDSolve[{y'[x]==y[x](c-((y[x])^2)),y[0]==y0},  y[x], {x, 0,5}], {y0,-(Sqrt[c]), (Sqrt[c]),((Sqrt[c])/4) }], Table[NDSolve[{y'[x]==y[x](c-((y[x])^2)),y[0]==y0},  y[x], {x, 0,5}], {y0,(Sqrt[c]),2,((2-(Sqrt[c]))/4)}]], Table[NDSolve[{y'[x]==y[x](c-((y[x])^2)),y[0]==y0},  y[x], {x, 0,5}], {y0, -2, 2, 0.4}]]],{x,0,5},PlotRange->{-2,2}, PlotStyle->Thick, ImageSize->Large,PlotLabel->Style["\!\(\*Cell[TextData[Cell[BoxData[
FormBox[
RowBox[{
RowBox[{"y", "'"}], "=", 
RowBox[{"y", "(", 
RowBox[{"c", "-", 
SuperscriptBox["y", "2"]}], ")"}]}], TraditionalForm]],
FormatType->"TraditionalForm"]]]\)",FontSize->18]], {c,-1,1,Appearance->"Labeled"}]

A pitchfork bifurcation is a bifurcation in which three equilibria merge.  The outer two equilibria must be of opposite type to the middle one. After (or before, depending on your point of view) the bifurcation, only the middle equilibrium will remain, but it will then have opposite character.

Traditional Bifurcation Diagrams

What is a Bifurcation Diagram?

Contour plots of f(y ; c)==0

Represent equilibria

Stable are solid curves, unstable dashed curves

Pros and Cons

Advantages

Relatively easy to sketch/plot

Some names related to shape of diagram

Disadvantages

Must classify equilibria prior to creation

Give no information as to why a bifurcation occurs

Example: Saddle-Node Bifurcation

Plot[{((1+(Sqrt[1+4c]))/2),((1-(Sqrt[1+4c]))/2)}, {c,-.4,.1}, PlotStyle->{Thick,{Thick,Dashed}}, Frame->True,Axes->False,FrameLabel-> {Row[{Style["Bifurcation Parameter ",16],Style[c, 16]}], Style[y,FontSize->16]}, PlotRange->{-.2,1.2},PlotLabel->Row[Style[#,18]&/@{"Bifurcation Diagram for ",HoldForm[y'==y(1-y)+c]}],Epilog->{Disk[{-.25, .5}, Offset[{6,6}]]}, ImageSize->Large ]

Example: Pitchfork Bifurcation

Clear[zeroRight, zeroLeft]
zeroLeft[x_] /; x<0 := 0
zeroRight[x_] /; x>0 := 0
Plot[{zeroLeft[x],  zeroRight[x],(Sqrt[x]), -(Sqrt[x])}, {x, -1,2}, PlotStyle->{{Thick},{Dashed,Thick}, {Thick}, {Thick}}, Axes->False,  PlotRange->{-2,2}, Frame->True,FrameLabel-> {Row[{Style["Bifurcation Parameter ",16],Style[c,16]}], Style[y,FontSize->16]},PlotLabel->Row[{Style["Bifurcation Diagram for",FontSize->18],Style[HoldForm[y'=y(c-(y^2))],18]}],Epilog->{Apply[Text[Style[If[#2(#1-#2^2)>0,f > 0, f<0], FontSize->16], {#1,#2}]&, {{1.5,.5}, {1.5,-.5}, {-.5,1.5}, {-.5, -1.5}}, {1}] , Text[Style[y==(Sqrt[c]),16],{.5,1}],Text[Style[y==-(Sqrt[c]),FontSize->16],{.5,-1}],Directive[Black,AbsolutePointSize[12]], Point[{0,0}]}, ImageSize->Large]

3-Dimensional Diagrams

What Do I Mean by a 3-Dimensional Bifurcation Diagram?

The graph of f(y;c) together with the f=0 section and zero or more c=constant sections.

f=0 represents equilibria

c=constant section represents gives the "dynamical vector field" at constant c => indicates stability of equilibria.

Fancy 3-Dimensional Diagram for Saddle-Node Bifurcation

Note: the interactive version requires a license for Knox Packages.  Just execute the cell if you have Knox Pacakges.
I include a sample image using c==0.

Manipulate[PlotSection[y(1-y)+x, {x, -1,1}, {y, -0.5,1.5}, XSection->d, XSectionStyle->Red,ZSection->0,ZSectionStyle->Black,BoxRatios->Automatic,  AxesLabel->(Style[#,Large]& /@ {c, y, f}), LabelStyle->Medium], {{d,0, Style[c,"TraditionalForm",18, FontFamily->"Times"]}, -1,1, Appearance->"Labeled"}]

Pros and Cons

Advantages

Does not require significant analysis to create

Clearly shows why bifurcation occurs

Can be used to determine the nature of equilibria

Disadvantages

Requires a powerful plotting program

Names of equilibria may not be as clear

May require significant computing power (don't create an interactive version in Mathematica 6)

A Slightly Simpler 3-D Diagram for Saddle-Node Bifurcation

Note: this code should work with Mathematica ≥ 6.0. Just execute the cell to see the result.  Mathematica ≥ 7.0 is recommended.

Manipulate[
	Show[
		Plot3D[y(1-y)+x, {x, -1,1}, {y, -0.5,1.5},
			BoxRatios->Automatic,
			AxesLabel->(Style[#,Large]& /@ {ToExpression["c"],y,f})
		],
		ContourPlot3D[z==0,{x, -1,1}, {y, -0.5,1.5}, {z,-2,2},
			ContourStyle->{Black, Opacity[0.5]}
		],
		ContourPlot3D[x==c,{x, -1,1}, {y, -0.5,1.5}, {z,-2,2},
			ContourStyle->{Red, Opacity[0.5]}, 
			RegionFunction->(#3< #2(1-#2)+#1&)
		]
	], 
	{{c,0}, -1,1, Appearance->"Labeled"}
]

A Basic 3-Dimensional Diagram for Saddle-Node Bifurcation

Note: this code should work with Mathematica ≥ 6.0. Just execute the cell to see the result.  Mathematica ≥ 7.0 is recommended.

Manipulate[
	Show[
		Plot3D[y(1-y)+x, {x, -1,1}, {y, -0.5,1.5}, 
			BoxRatios->Automatic, AxesLabel-> {"c",y,f}, 
			PlotRange->{-2,1.5}
		],
		ContourPlot3D[{z==0,x==c}, {x, -1,1}, {y, -0.5,1.5}, 
			{z,-2,2}, ContourStyle->{{Black, Opacity[0.75]},
				{Red,Opacity[0.75]}}
		]
	], 
	{{c,0}, -1, 1,Appearance->"Labeled"}
]

Fancy 3-Dimensional Diagram for Pitchfork Bifurcation

Note: the interactive version requires a license for Knox Packages.  Just execute the cell if you have Knox Pacakges.
I include a sample image using c==0.

Manipulate[PlotSection[y(x-(y^2)), {x, -1,1}, {y, -1,1}, XSection->d, ZSection->0,BoxRatios->Automatic, Fudge->0.02, XSectionStyle->Red, ZSectionStyle->Black,PlotRange->All,AxesLabel->(Style[#,Large]& /@ {c, y, f})], {{d,0,Style[c,"TraditionalForm", 18, FontFamily->"Times"]}, -1,1,Appearance->"Labeled"}]

Reception

Student Reception

Positive

Students could create such diagrams on their own, even on timed exams

Students could clearly explain how the diagram indicated the type of bifurcation

Some stated directly that these "made a lot more sense than the book"

They liked the pretty pictures

Negative

Very weak students have trouble creating their own graphs (especially interactive ones)

Faculty Reception

"I never thought to use PlotSection in DE's, but that's a really nice application"  (Dennis Schneider)

"Ooooh, that's pretty!" (name withheld to protect reputation)