Don't like to read manuals? Go directly to Javaphaser!



Students of electrical engineering, physics, and many other fields often find that dynamical systems are useful models for the phenomena they encounter. The meteorologist E. N. Lorenz, for example, tried to use one for weather rediction. Javaphaser is a tool which draws the phase portrait of any such system entered in its input fields.


Two sections comprise Javaphaser's applet window. On the left is a graphical area, in which the systems are drawn. On the right is a control panel. This panel contains, from top to bottom, two fields for entering the system, a message area, and a command area.

Initial conditions for a trace can be set by clicking the mouse in the graphical area.

The system fields are connected to a parser which interprets mathematical expressions. This parser requires that input adhere strictly to certain rules. These are:

1. The following operations are available: addition (+), subtraction (-), multiplication (*), division (/), and exponentiation(^).

2. The following operations are forbidden: implicit multiplication (5x != 5*x), negation (-x != 0-x), and FORTRAN-style exponentiation (**).

3. The following functions are defined: trigonometrics (sin(x), cos(x), tan(x)), natural logarithm (ln(x)), and exponential (exp(x)).

4. The following constants are defined: pi (PI), and Euler's number (E).

5. The following characters are recognized as variables: "x", "y", and "t".

The message area prints information about changes in the applet's status and error messsages.

The command area allows very fine control of the manner in which a system is drawn. Commands are invoked by clicking the EXEC button with the mouse and then pressing a key. Parameters for these commands are read from the adjacent parameter field.


The following program parameters may be changed through the command area:

Scale: the number of pixels per unit. (I.e. the displacement from the origin in pixels of the point (1, 0).)

Timestep: the amount by which t is incremented each time the position is recalculated. Lower values make the rendering more accurate.

x, y, and t coordinates: If the mouse is insufficiently accurate, the x and y coordinates of the current trace can be set. Also, the value of t can be specified.

Number of traces: some systems can be explored more easily with several traces drawn in parallel. More than 20 is not recommended.

Which trace has focus: this trace is the one which changes position in response to mouse clicks or the commands to set x, y, and t.

Number of recalculations per redraw: In some cases, setting this to a number other than 1 will speed up drawing without decreasing accuracy. The Runge-Kutta integrator this applet uses is, however, fast enough and accurate enough for this value to be safely left at its default value of 1.

Set number of tracesb Positive integer
Select traced Positive integer
Select next tracee --
Clear drawing areac --
Reset appletr --
Step forward by timestep and redrawi--
Change xx Decimal number
Change yy Decimal number
Set time for selected traceaDecimal number
Set number of recalculations per redrawf Positive integer
Set scales Positive integer
Set timesteptDecimal number


A good differential equations textbook will have a chapter on dynamical systems. Those of the following indicated with an asterisk were taken from chapter 6 of _Differential Equations_ by Edwards and Penny.

Simplified pendulum , mass-spring, or ideal LC circuit:
x' = y
y' = 0-x

x' = y
y' = 0-sin(x)

* Damped pendulum:
x' = y
y' = 0-3.6*sin(x)-0.5*y

Lienard - van der Pol:
x' = y - (x^3-x)
y' = 0-x

* Predator-prey:
x' = x-x*y
y' = x*y-y

* page 380, problem 12
x' = y
y' = 8*x-2*x^3

* Duffing's oscillator
x' = y
y' = K*cos(t)-(x^3-x+y)
(Try varying K. Start with 0.4)

Forced LRC circuit:
x' = 0.1*y
y' = sin(t) - (x+y)


Differential Equations. C. H. Edwards Jr. and David E. Penny. Englewood Cliffs, NJ: Simon and Schuster, 1996.

Scientific Computing. Michael T. Heath. McGraw Hill, 1997.

Matthew Woodruff