Java Applet for Phase Plane
The PRINT option is currently disabled
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. Same for y'(t).
For a nonautonomous system y'=f(t,y)
you can just think of x as t, and write x'=1
and y'=f(x,y). For example, the figure
for dy/dt = y-t can be obtained by entering:
x' = 1
y' = y - x
click "show vectors", and then click an initial condition (try, for instance,
clicking at (0,-2.5), (0,1) and (-2.5,2.5)).
Click anywhere in the graphing window to select an initial condition.
Click the Endpoints button to open a panel where you can
adjust the range of x and y, or to
change the time interval over which the solution is computed.
Click Erase for any changes to take effect.
Click the Show/Hide Vectors button to toggles the display of the
slope field .
Click I.C. Grid to see 8 solution curves, from a grid of initial
Use symbols "E" and "PI" for e and pi; use ^ for powers
(e.g., x^2 is x squared);
write other functions as usual, e.g. tan(3*log(x))
The parser recognizes all of the standard math functions defined in
The symbols "E" and "PI" are recognized as java's Math.E and Math.PI.
The parser was written by Darius Bacon and is available at his web site. Please see his file on copying the software.
The java source for the rest of the applet lives in the three files:
InputPanel.java. Please do not use
it as an example of good java code.
The package uses a 4th order Runge-Kutta solver with a constant width
mesh of 400 points, 200 from t = 0 to t = tmax and 200 from t = 0 to
t = tmin. With this rather crude method it is easy to generate equations
for which the solver fails badly (try x' = x^3). (As an aside, I have
noticed that it is very easy to convert the code in Numerical Recipies
in C into java code. A much better solver would be easy to write.)
Copyright © 1997 by Scott A. Herod. All rights reserved.
Last updated by Scott Herod on
January 27, 1997.
(Copied to Rutgers by permission.)
Back to E. Sontag's Homepage