# Fast Numerical Solution of ODE

CECM The Physics Institute

### Contents: DNA routines, Release1.04(last updatedNov/06/2001).

Changes over release 1.03:
Addition of Heaviside and piecewise functions to the list of allowed functions (Note: we use Heaviside(0)=1/2)

Authors: E.S. Cheb-Terrab and A.Wittkopf

" The idea is to encode the information contained in the ODE system into a sequence of numbers representing one-operation instructions. Then, while inside a Maple worksheet, the whole computation is performed in a single call to an external library without requiring a compiler... "

Comments: By using the external call mechanism of Maple 7 and Maple 6, the DNA routines provide, in Maple 7: a 2x <-> 30x speed up (typically around 8x), and in Maple 6 a 15x <-> 30x speed up in the numerical integration of typical Ordinary Differential Equations (ODEs - Initial Value Problems). So, ODEs solved in 1 minute in the official Maple 7 are typically solved in few seconds after installing the DNA libraries. DNA performs computations using significantly less memory too, from 1/10 to 1/10000, depending on the ODE problem. DNA doesn't require any additional C compilers or whatever additional "non-Maple" software. Anyone having a copy of Maple 7 or Maple 6 can use it.

The DNA routines are used directly through Maple's dsolve, odeplot and DEplot commands. The calling sequence to dsolve was not changed but for the addition of the new method. So ODEs numerically solved in Maple 6/7 via

`   > dsolve( {ODE, initial_conditions}, {funcs}, numeric);`

will be solved with the new library via

`   > dsolve( {ODE, initial_conditions}, {funcs}, numeric, method=dna);`

where the optional argument method=dna is all the change required in the input to run an average of 7 times faster. If the 'method=dna' is not present in the arguments, the ODE will be solved using the standard Maple methods. Examples of the use of these routines with dsolve, odeplot and DEplot are found in a demo worksheet for Maple 6 and Maple 7. Examples of the use of DNA libraries to compute Poincare surface-of-sections are found in a Poincare_and_DNA worksheet

The contents of the dna6.zip (Maple 6) and dna7.zip (Maple 7) files are

 - maple.lib and maple.ind (the multi-platform maple libraries) - libdna-x86-Linux.so (binary C library just for Linux users) - libdna-Sun-Solaris.so (binary C library just for Sun users) - dna.dll (binary C library just for windows users) - dna.mws (worksheet with examples and comments.) - poincare_and_dna.mws (worksheet with examples and comments.) - readme.txt (additional installation instructions)

The package is also available bundled with the latest other packages maintained by my co-author ODEtools, and PDEtools as ode-pde-dna7.zip.

Installation in Linux/Sun is simple:

• add maple.ind and maple.lib to a directory in your libname path (before the official Maple library)
• rename the appropriate compiled library to libdna.so
• add the location of the compiled library to the LD_LIBRARY_PATH

As is installation in windows:

• add maple.ind and maple.lib to a directory in your libname path (before the official Maple library)
• copy the file dna.dll to the directory where your wmaple.exe file is found (usually "C:\Program Files\Maple 6\bin.wnt" or "C:\Program Files\Maple 7\bin.wnt")

More detailed instructions and additional tips for installation can be found in the readme.txt file distributed with the package. Other platforms are not supported yet.