Next: User-defined Functions Up: Typing Equations Previous: Equation Syntax

## Variables and Parameters

The program recognizes the difference between variables and parameters through their presence (or lack thereof) on the left side of an equal sign. Variables are recognized by appearing on the left side of the equals sign. User defined functions are recognized by having a left parenthesis after them. Everything between the left parenthesis and the equal sign is ignored by the program. Any other object that is not a numerical constant, intrinsic function, or operation is taken to be a parameter by the program. When the program parses equations, it indicates the variables and parameters that it has found so far at the bottom of the Equation dialog box. An example of proper definitions of variables and functions follows.

f(x,y) = x^2 + y^2
x'=y
y'= - alpha*f

At the bottom of the dialog box after this definition, you should see

Variables: f x y Parameters: alpha

You may type equations of order higher than one, if you wish. The proper syntax is to place the variable with the highest-order derivative on the left of the equal sign, and the rest of the equation to the right. For example, x''=sin(x)/x is syntactically correct, while xx''=sin(x) is not. When the term to the left of the equal sign is of order greater than one, then terms containing derivatives may appear to the right of the equal sign, e.g. u''= -sin(u) + au'. Any equation of order greater than one is converted into a first-order system by the program. The program creates new variables to correspond to derivatives of the given variable by replacing the prime by a 'p'. For example, the equation x''= -a*x-x' becomes the system

x'=xp
xp'=-a*x-xp.

When you enter equations for a function iteration, you may want to indulge in an alternate syntax. It is acceptable to type equations of the form e.g. x=x+1, meaning that a new value for x is computed by adding one to the old value, i.e . Thus x=x^2+4 is perfectly acceptable DynaSys syntax, though mathematically it is nonsense. Its meaning is identical to that of the DynaSys expresssion x(x)=x^2+4.

One subtlety of the syntax is that the difference between variables and user-defined functions is slight. In fact, the program considers user-defined functions to be variables, but treats them in a special way. For details, see the section on User-defined Functions. We simply note that user-defined functions are indicated as variables at the bottom of the Equation dialog box.

Next: User-defined Functions Up: Typing Equations Previous: Equation Syntax

Kevin Cooper
Wed Sep 30 15:21:52 PDT 1998