by Dennis Darland Mail To: pal at dennisdarland dot com

dennisdarland.comComments welcome

### The differential equations to be solved are given here.

- They may be given in any order.
- The highest derivative of each equation appears on the left hand side.
- Then there is an equals sign '=' not ':='.
- Then the right hand side, followed by a semicolon, ';'
- Derivatives are given as 'diff(z,t,n)'.
- Here 'z' is a dependant variable, 't' the independent variable and 'n' the order of the derivative (which must be an integer constant)
- Function (given below) and numeric constants, and '+', '-', '/', and '*' may be used.
- There is however no unary '+' or '-' - but 'm1' may be used for negative one.
- Comments begin with a "#" and must be the last thing on that line.
- The block is terminated by an exclamation point, '!'.

### Data that is needed early goes here. Only assignment statements or comments go here. (Using ':=' as in Maple.)

- Comments begin with a "#" and must be the last thing on that line.
- 'max_terms' Must be set to the number of Taylor series terms. Arrays used in data block 2 will be allocated.
- 'Digits' may be set in Maple. This has no effect in the other languages.
- The block is terminated by an exclamation point, '!'.

### Other data for the problem are given here Only assignment statements, comments or a special form for setting initial conditions go here.

- Samples:
- t_start := value;
- t_end := value;
- # The next statement says the 0th derivative of z starts (at t_start) at value.

- diff(z,0,value);
- glob_desired_digits_correct := value;
- glob_display_interval := value;
- glob_min_h := value;
- glob_max_h := value;
- glob_look_poles := value;
- glob_max_iter := value;
- glob_max_hours := value;
- glob_max_minutes

- The starting and end positions are given. The independent variable from the equation block is used.
- The initial values if the dependent variables are given.
- The variable, order of derivative (without 1 added) and initial value are given in a diff statement.
- The variables from the equation block are again used. These are derivatives - not Taylor series terms.
- glob_desired_digits_correct is set. It is used to set glob_h, but does not always work.
- glob_display_interval sets the maximum interval between data points calculated. Consequently it is also a maximum for glob_h. It can be used to reduce glob_h if glob_desired_digits_correct is ineffective. It is better to use glob_max_h, unless one wants the extra data displayed.
- glob_max_h can set a maximum h which is smaller than the increment calculated and smaller, possibly also, than glob_display_interval.
- glob_min_h can set a minimum h which is larger than otherwise would have been used.
- glob_look_poles is set to true or false. If true the output will give information about poles. (Currently required - not tested without set to true)
- glob_max_iter sets a maximum number of iterations.
- It can be useful to set a low number of iterations, as a time estimate for a complete solution will be given.
- There is also a maximum time of 60*glob_max_hours + glob_max_minutes. The default is 15 minutes.
- If there is a file "ode.over" in the current directory, then any values set in it for the above variables will override those in this block.

### Here analytic (closed form) solutions may be given.

- If analytic solutions are not known, functions must be given, but may be set to zero.
- These functions can also be used in the second data block to set initial values for the dependent variables in terms of the initial value of the independent variable.
- In c and c++ any local variables will be type double.
- sample:

exact_soln_x1 := proc(t)

local c1,c2,c3;

# comments can also go here

c1 := 0.0001;

c2 := 0.0002;

c3 := 0.0003;

2.0 * c1 + 6.0 * c3 * exp(-t);

end;

exact_soln_x2 := proc(t)

local c1,c2,c3;

c1 := 0.0001;

c2 := 0.0002;

c3 := 0.0003;

c1 + c2 * exp(2.0 * t) + c3 * exp(-t);

end;

exact_soln_x2p := proc(t)

local c1,c2,c3;

c1 := 0.0001;

c2 := 0.0002;

c3 := 0.0003;

2.0 * c2 * exp(2.0 * t) - c3 * exp(-t);

end;

- Only proc heading statements (in one line), local declarations, assignments, a expression, and an end statement are supported.
- The block is ended by the end of the file.
- derivatives are indicated by a p (for prime) at the end of the function name.