Phase Portraits for ODE's and Autonomous Systems

PENN  STATE 
DEPARTMENT  O MATHEMATICS 

Author Richard Mansfield: melvin@math.psu.edu

Click in white panel to select initial conditions!

To plot the solution curves of a two dimensional system of autonomous differential equations, click on the box beside the x'(t) = label and enter an expression. The TAB key will cycle you through to the next field where you can enter the right hand side of the second equation. You will need to clear the screen for these changes to take effect. Click anywhere in the top window to select an initial condition.

The little direction field lines are colored to indicate time's arrow. The green end is forward in time, and red is backwards.

You may also plot a single first order equation by letting x'=1. Or better yet, since dy/dx = y'/x', to solve dy/dx = f(x,y), choose any two functions whose ratio is f. That is what I have done with the default equations. They really represent the single equation dy/dx=x^2/(3*y^2-4). By separating out the numerator and denominator, this avoids the possible division by zero and allows the curve to turn around and go backwards.

The window button will open another panel where you can adjust the range of x and y that are displayed on the screen.

If you enter bad expressions in the x' or y' textfields, clicking to set initial conditions will do nothing. If you enter bad numbers in the window pop-up, "ok" will not hide the box. In any event you can always go back and fix the mistake.

Printing the graphics you generate is not entirely a trivial process. Because of entirely justified security concerns, most web browsers will not give this applet access to your file system and so it cannot print anything. You will have to grab the graphics with your own screen grabber (say xv in linux or snapshot on a Sun system) and print it yourself. There must be some equivalent programs for Win95 or Mac.

The parser was written by Darius Bacon and is available at his web site. Please see his file on copying the software.

Note on stepsize: The stepsize is adjusted dynamically. What I do is set the variable maxjump to be half the perimeter of the window divided by 200. Then at any point in the screen, I define Mod to be the maximum of sqrt((x')^2+(y')^2)) and .01. Then the local stepsize is maxjump/Mod. This prevents huge jumps from one point to the next, even when the derivatives are very large and allows for a modest speed up when they are small.