Lagrange Applet Parameters

Name: Lagrange
Author: Peter Selinger
Version: 0.15
Documentation: http://www.mathstat.dal.ca/~selinger/lagrange/

The Lagrange Applet has eight general parameters that determine the basic functions of the applet. In addition, for each specific physical system (such as, a double pendulum) there is a set of parameters that determine the physical properties and initial condition of the system.

### General Parameters

All parameters are optional. The default for each parameter is shown in bold face.

 Name Possible Values Description type DoublePendulum, SpringPendulum, DoubleSpring Physical system to be displayed. frames a positive integer (10) Number of frames per second. timefactor a decimal fraction (1.0) Time factor for slow or fast motion. trace true, false Draw a trace? controls true, false Display a panel of control buttons? showenergy true, false Display the total energy? constrainenergy true, false Enforce energy preservation? energycontrol true, false Display button to toggle energy preservation? deterministic true, false Deterministic simulation? bgcolor #xxxxxx (getBackground()) The background color. fgcolor #xxxxxx (#000000) The foreground color. tracecolor #xxxxxx (#ffffff) The color of the trace. scalecolor #xxxxxx (#000000) The color of the metric scale. timecolor #xxxxxx (#000000) The color of the time scale. energycolor #xxxxxx (#000000) The color of the energy display.

### Parameters for type = DoublePendulum

Each of the following parameters takes a value of type double.

 Name Default Description m0 2 inner mass, in kg m1 3 outer mass, in kg l0 6 inner length, in m l1 4 outer length, in m g 9.81 gravity, in m/s^2 alpha 2.2 initial value for angle of inner leg, counterclockwise from south, in radians alpha' 0 initial derivative for angle of inner leg, counterclockwise from south, in radians beta 3 initial value for angle of outer leg, counterclockwise from south, in radians beta' 0 initial derivative for angle of outer leg, counterclockwise from south, in radians

### Parameters for type = DoubleSpring

 Name Default Description m 1 mass, in kg l0 1 first spring length, in m l1 1 second spring length, in m k0 5 first spring constant, in N/m k1 1 second spring constant, in N/m b 1.9 distance between pivot points, in m g 0 gravity, in m/s^2 x 1.2 initial value for coordinate of mass, to right of midpoint of pivots, in m x' 0 initial derivative for coordinate of mass, to right of midpoint of pivots, in m y 1 initial value for coordinate of mass, above midpoint of pivots, in m y' 0 initial derivative for coordinate of mass, above midpoint of pivots, in m

### Parameters for type = SpringPendulum

 Name Default Description m0 2 inner mass, in kg m1 1 outer mass, in kg l0 6 inner length, in m l1 4 outer length, in m k0 60 spring constant, in N/m g 9.81 gravity, in m/s^2 x 2.2 initial value for coordinate of inner mass, right of pivot, in m x' 0 initial derivative for coordinate of inner mass, right of pivot, in m y 3 initial value for coordinate of inner mass, above pivot, in m y' 0 initial derivative for coordinate of inner mass, above pivot, in m alpha 1 initial value for angle of outer leg, counterclockwise from south, in radians alpha' 0 initial derivative for angle of outer leg, counterclockwise from south, in radians

### A Sample Applet Tag

A typical applet tag for the Lagrange Applet might look like this:
```<applet codebase=http://www.mathstat.dal.ca/~selinger/lagrange/codebase
code=Lagrange.class width=350 height=350>
<param name=type value=DoublePendulum>
<param name=frames value=10>
<param name=trace value=true>
<param name=controls value=true>
<param name=bgcolor value=#ffffcc>
<param name=fgcolor value=#000000>
<param name=tracecolor value=#ff0000>
<param name=scalecolor value=#0000ff>
</applet>
```

Back to main Lagrange page.
Back to Peter Selinger's Homepage:
Peter Selinger / Department of Mathematics and Statistics / Dalhousie University
selinger@mathstat.dal.ca / PGP key
Updated May 12, 2000