Nullcline Plots

This notebook requires the input file "VisualDSolve" to be preloaded on your computer. "VisualDSolve" is a package developed by D. Schwalbe and S. Wagon.

Nullcline Plot Example (Balsa-Wood Glider)

Needs["VisualDSolve`"];

The following code produces a picture of the nullclines of a system of 2 differential equations. The x-nullcline is depicted in yellow, the y-nullcline in orange. Their intersections, the equilibrium points, are depicted in black.
The regions cut out by the nullclines are shown in four different gray shades, corresponding to the four basic vectorfield directions:
nearly white=Northwest                 light gray=Southeast
gray=Southwest                             dark gray=Northeast.
To start, execute the command above once at the beginning of the session.
Enter the differential equations such as x'[t]==x[t]-y[t],y'[t]== y[t](1-x[t]^2-y[t]^2), choose the bounds of the plotted region (in this example: x and y lie between -1.5 and 1.5), then execute the command below.
If the picture looks "rugged", increase the number in "NullclinePlotPoints" (this slows things down!)

\(\(PhasePlot[{\(x'\)[t] == x[t]^2 - y[t]^2 - 1, 
        \(y'\)[t] == \ x[t]^2 + y[t]^2 - 4}, 
	{x[t], y[t]}, 

      	{x, \(-2.5\), 2.5}, {y, \(-2.5\), 2.5}, 
	ShowEquilibria -> True, 

      	Nullclines -> True, 
	NullclineShading -> True, 
	
      NullclinePlotPoints -> 75, 
	AxesLabel -> {x, y}, 
	
      PlotPoints -> 100, 
	
      NullclineStyle -> 

        		{{Thickness[.008], Yellow}, {Thickness[.008], Orange}}, 
      AspectRatio -> Automatic]; \)\)

Here is the same picture with a "flow field" included. A flow field is similar to a vector field, but also indicates the local concavity of the solutions.
 Red "fish" indicate fast movement in the phase plane, light blue "fish" indicate a very slow movement.

\(\(PhasePlot[{\(x'\)[t] == x[t]^2 - y[t]^2 - 1, 
        \(y'\)[t] == \ x[t]^2 + y[t]^2 - 4}, 
	{x[t], y[t]}, 

      	{x, \(-2.5\), 2.5}, {y, \(-2.5\), 2.5}, 
	FlowField -> True, 
	
      FieldLogScale -> 6, 
	FieldColor -> Hue, 
	
      FieldThickness -> Thickness[0.006], 
	ShowEquilibria -> True, 
	
      Nullclines -> True, 
	NullclineShading -> True, 
	
      NullclinePlotPoints -> 75, 
	AxesLabel -> {x, y}, 
	
      PlotStyle -> Thickness[0.008], 
	ShowInitialValues -> True, 
	
      PlotPoints -> 100, 
      NullclineStyle -> 

        		{{Thickness[.008], Yellow}, {Thickness[.008], Orange}}, 
      AspectRatio -> Automatic]; \)\)

A "Bug"?

Be careful!! This program seems to have a "bug". What's wrong with the following picture?

\(\(PhasePlot[{\(x'\)[t] == y[t], 
        \(y'\)[t] == \(-.2\)\ y[t] - Sin[x[t]]}, 
	{x[t], y[t]}, 

      	{x, \(-5\), 5}, {y, \(-5\), 5}, 
	ShowEquilibria -> True, 
	
      Nullclines -> True, 
	NullclineShading -> True, 
	
      NullclinePlotPoints -> 75, 
	AxesLabel -> {x, y}, 
	
      PlotPoints -> 100, 
	
      NullclineStyle -> 

        		{{Thickness[.008], Yellow}, {Thickness[.008], Orange}}]; \)\)

At least in this example, this can be fixed by changing the method in which the regions are found: We include among the options: NullclineShadingMethod->SumOfSigns, producing the correct, but  more "rugged" picture.

PhasePlot[{x'[t] == y[t], y'[t] == -.2 y[t] - Sin[x[t]]},
	{x[t], y[t]},
	{x, -5, 5},{y, -5, 5},
	NullclineShadingMethod -> SumOfSigns,
	ShowEquilibria -> True,
	Nullclines -> True,
	NullclineShading -> True,
	NullclinePlotPoints -> 75,
	AxesLabel -> {x, y},
	PlotPoints -> 100,
	\(NullclineStyle -> 

            		{{Thickness[.008], Yellow}, {Thickness[.008], Orange}}\)];

Etc.