Previous Page Next Page Contents

detools::modode -- modified equation

Introduction

detools::modode implements the method of the modified equation for the analysis of numerical integration methods applied to ordinary differential equations.

Call(s)

detools::modode(Psi, depvars, indvar, step, order)
detools::modode(F, method, depvars, indvar, step, order)

Parameters

Psi - the step function for the numerical method applied to the given differential equation: a list of expressions
depvars - the names of the unknown functions: a list of (indexed) identifiers.
indvar - the name of the independent variable: an (indexed) identifier.
step - the name of the step size: an (indexed) identifier.
depvars - the order (in step) to which the modified equation should be computed: a positive integer.
F - the right hand side of the differential equation: a procedure of the same form as required by numeric::odesolve.
method - the name of the chosen numerical method: a string.

Returns

a list of expressions representing the right hand side of the modified equation.

Related Functions

numeric::odesolve

Details

Example 1

The following input determines the modified equation of order 3 for the (forward) Euler method applied to the differential equation diff(y,t)=z and diff(z,t)=-y.

>> detools::modode([z, - y], [y, z], t, h, 3)
            --            2      3               2      3   --
            |      h y   h  z   h  y  h z       h  y   h  z  |
            |  z + --- - ---- - ----, --- - y + ---- - ----  |
            --      2     3      4     2         3      4   --

The same result is obtained with the following sequence of commands.

>> F := proc(t,y) begin [y[2], - y[1]] end_proc:
   detools::modode(F, EULER1, [y, z], t, h, 3)
            --            2      3               2      3   --
            |      h y   h  z   h  y  h z       h  y   h  z  |
            |  z + --- - ---- - ----, --- - y + ---- - ----  |
            --      2     3      4     2         3      4   --



Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000