# FreeBSD Manual Pages

ODE(1) GNU Plotting Utilities ODE(1)NAMEode - numerical solution of ordinary differential equationsSYNOPSISode[options] [file]DESCRIPTIONodeis a tool that solves, by numerical integration, the initial value problem for a specified system of first-order ordinary differential equations. Three distinct numerical integration schemes are available: Runge-Kutta-Fehlberg (the default), Adams-Moulton, and Euler. The Adams-Moulton and Runge-Kutta schemes are available with adaptive step size. The operation ofodeis specified by a program, written in its input language. The program is simply a list of expressions for the deriva- tives of the variables to be integrated, together with some control statements. Some examples are given in theEXAMPLESsection.odereads the program from the specified file, or from standard input if no file name is given. If reading from standard input,odewill stop reading and exit when it sees a single period on a line by itself. At each time step, the values of variables specified in the program are written to standard output. So a table of values will be produced, with each column showing the evolution of a variable. If there are only two columns, the output can be piped tograph(1) or a similar plotting program.OPTIONSInputOptions-ffile--input-filefileRead input fromfilebefore reading from standard input. This option makes it possible to work interactively, after reading a program fragment that defines the system of differential equa- tions.OutputOptions-pprec--precisionprecWhen printing numerical results, useprecsignificant digits (the default is 6). If this option is given, the print format will be scientific notation.-t--titlePrint a title line at the head of the output, naming the vari- ables in each column. If this option is given, the print format will be scientific notation.IntegrationSchemeOptionsThe following options specify the numerical integration scheme. Only one of the three basic options-R,-A,-Emay be specified. The de- fault is-R(Runge-Kutta-Fehlberg).-R[stepsize]--runge-kutta[stepsize]Use a fifth-order Runge-Kutta-Fehlberg algorithm, with an adap- tive stepsize unless a constant stepsize is specified. When a constant stepsize is specified and no error analysis is re- quested, then a classical fourth-order Runge-Kutta scheme is used.-A[stepsize]--adams-moulton[stepsize]Use a fourth-order Adams-Moulton predictor-corrector scheme, with an adaptive stepsize unless a constant stepsize,stepsize, is specified. The Runge-Kutta-Fehlberg algorithm is used to get past `bad' points (if any).-E[stepsize]--euler[stepsize]Use a `quick and dirty' Euler scheme, with a constant stepsize. The default value ofstepsizeis 0.1. Not recommended for seri- ous applications. The error bound options-rand-e(see below) may not be used if-Eis specified.-hhmin[hmax]--step-size-boundhmin[hmax]Use a lower boundhminon the stepsize. The numerical scheme will not let the stepsize go belowhmin. The default is to al- low the stepsize to shrink to the machine limit, i.e., the mini- mum nonzero double-precision floating point number. The optional argumenthmax, if included, specifies a maximum value for the stepsize. It is useful in preventing the numeri- cal routine from skipping quickly over an interesting region.ErrorBoundOptions-rrmax[rmin]--relative-error-boundrmax[rmin]The-roption sets an upper bound on the relative single-step error. If the-roption is used, the relative single-step error in any dependent variable will never exceedrmax(the default for which is 10^-9). If this should occur, the solution will be abandoned and an error message will be printed. If the stepsize is not constant, the stepsize will be decreased `adaptively', so that the upper bound on the single-step error is not violated. Thus, choosing a smaller upper bound on the single-step error will cause smaller stepsizes to be chosen. A lower boundrminmay optionally be specified, to suggest when the stepsize should be increased (the default forrminisrmax/1000).-eemax[emin]--absolute-error-boundemax[emin]Similar to-r, but bounds the absolute rather than the relative single-step error.-s--suppress-error-boundSuppress the ceiling on single-step error, allowingodeto con- tinue even if this ceiling is exceeded. This may result in large numerical errors.InformationalOptions--helpPrint a list of command-line options, and exit.--versionPrint the version number ofodeand the plotting utilities pack- age, and exit.DIAGNOSTICSMostly self-explanatory. The biggest exception is `syntax error', meaning there is a grammatical error. Language error messages are of the formode:nnn:message...where `nnn' is the number of the input line containing the error. If the-foption is used, the phrase "(file)" follows the `nnn' for errors encountered inside the file. Subsequently, whenodebegins reading the standard input, line numbers start over from 1. No effort is made to recover successfully from syntactic errors in the input. However, there is a meager effort to resynchronize so more than one error can be found in one scan. Run-time errors elicit a message describing the problem, and the solu- tion is abandoned.EXAMPLESThe programy'=yy=1t,ystep0,1solves an initial value problem whose solution isy=e^t. Whenoderuns this program, it will write two columns of numbers to standard output. Each line will show the value of the independent variablet, and the variabley, astis stepped from 0 to 1. A more sophisticated example would besine'=cosinecosine'=-sinesine=0cosine=1t,sinestep0,2*PIThis program solves an initial value problem for a system of two dif- ferential equations. The initial value problem turns out to define the sine and cosine functions. The program steps the system over a full period.AUTHORSodewas written by Nicholas B. Tufillaro (nbt@reed.edu), and slightly enhanced by Robert S. Maier (rsm@math.arizona.edu) to merge it into the GNU plotting utilities.SEE ALSO"The GNU Plotting Utilities Manual".BUGSEmail bug reports tobug-gnu-utils@gnu.org. FSF Dec 1998 ODE(1)

NAME | SYNOPSIS | DESCRIPTION | OPTIONS | DIAGNOSTICS | EXAMPLES | AUTHORS | SEE ALSO | BUGS

Want to link to this manual page? Use this URL:

<https://www.freebsd.org/cgi/man.cgi?query=ode&sektion=1&manpath=FreeBSD+12.2-RELEASE+and+Ports>