Ode file specifications

by Dennis Darland Mail To: pal at dennisdarland dot com

dennisdarland.com

Comments welcome

The equation block

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

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

The rest of the blocks are a subset of Maple - even when code is being generated for another language

The first data block.

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

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

The second data block.

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

  2. Samples:
  3. The starting and end positions are given. The independent variable from the equation block is used.
  4. The initial values if the dependent variables are given.
  5. The variable, order of derivative (without 1 added) and initial value are given in a diff statement.
  6. The variables from the equation block are again used. These are derivatives - not Taylor series terms.
  7. glob_desired_digits_correct is set. It is used to set glob_h, but does not always work.
  8. 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.
  9. glob_max_h can set a maximum h which is smaller than the increment calculated and smaller, possibly also, than glob_display_interval.
  10. glob_min_h can set a minimum h which is larger than otherwise would have been used.
  11. 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)
  12. glob_max_iter sets a maximum number of iterations.
  13. It can be useful to set a low number of iterations, as a time estimate for a complete solution will be given.
  14. There is also a maximum time of 60*glob_max_hours + glob_max_minutes. The default is 15 minutes.
  15. 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.

The procedures block

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

  2. If analytic solutions are not known, functions must be given, but may be set to zero.
  3. 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.
  4. In c and c++ any local variables will be type double.
  5. 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;
  6. Only proc heading statements (in one line), local declarations, assignments, a expression, and an end statement are supported.
  7. The block is ended by the end of the file.
  8. derivatives are indicated by a p (for prime) at the end of the function name.
SourceForge Logo