Function and differential equation plotter

This applet plots one of:

The given function is plotted over the specified range of x and y values, using the given initial conditions and a second/fourth order Runge-Kutta method for the differential equations.

Use the buttons to scroll round or re-draw the graph. The scrollbars should be followed by a press on the draw button.

The right-hand side of the differential equation can be any function of x, y and dydx (or D) involving the functions sin, cos, tan, asin, acos, atan, sec, cosec, cot, asec, acosec, acot, sinh, cosh, tanh, asinh, acosh, atanh, sech, cosech, coth, asech, acosech, acoth, abs (or |...|), ceil, floor, exp, log (base e), max(a,b), min(a,b), pow(a,b) (or a^b), round, sqrt and delta (delta(x) = 1 if x>0, 0 otherwise). You can also use the values e, pi and random. The latter returns a uniform distribution on 0..1. Use * for multiplication and round or square brackets to override the usual priorities of operators.

The boundaries and initial values can be input as expressions, but they must be constant expressions, of course!

As you move the mouse round the graph, the corresponding x- and y-value should appear in the status line. Clicking on the graph will move the initial value of x and y to that point. Thus you can investigate how the solution varies with different initial conditions. The initial value of the first derivative can be input from the text fields or can be set by dragging the mouse from the initial point.

View the source for an example, but the function and order of the DE can be changed at run time.

The main class is RungeKutta, which uses the classes Graph as its graphics area, Cartesian as a generic point and FunctionParse to parse and evaluate a function.

Without Java enabled, you see nothing here!

JARS


Back to Mike Piff's Java page
M.Piff@shef.ac.uk

Valid HTML 4.0!