next up previous
Next: Implementation Up: Program Structure Previous: Updates

Expressions

 

Expressions are made up mainly of identifiers separated by operators. RNPL defines the usual set of arithmetic operators ( +,-,*,/) along with exponentiation ( ^ or **). The operators obey the usual precedence rules.

Identifiers may be names of grid functions, coordinates, or parameters. In addition, grid functions may be supplied with temporal and spatial offsets (see section 1.7), and coordinates may be supplied with a spatial offset.

Expressions can also contain the well-known functions exp, ln, tan, sin, cos, and sqrt as well as derivative operators.

Here is an example of a complicated RNPL expression:

a*b+(c*2.67/<0>phi[1] + d^2)/tan(theta) - r[-1]*D_(phi*3/a,r) +
  cos(3*eta)*D_(eta+D_(phi,r),r) + expand D_(a*b + c,r)

You'll notice the word expand before the last derivative operator. This tells RNPL to symbolically expand the derivative before making the operator substitution. Thus, the final term is equivalent to:

D_(a,r)*b + a*D_(b,r) + D_(c,r)



Robert Marsa
Thu Jun 1 09:34:30 CDT 1995