Up | Next | Prev | PrevTail | Tail |
A Runge-Kutta method of order 3 finds an approximate graph for the solution of a ordinary differential equation real initial value problem.
Syntax:
num_odesolve
(\(exp\),\(depvar=dv\),\(indepvar\)=\((from .. to)\)
\( [,accuracy=a][,iterations=i]) \)
where
\(exp\) is the differential expression/equation,
\(depvar\) is an identifier representing the dependent variable (function to be found),
\(indepvar\) is an identifier representing the independent variable,
\(exp\) is an equation (or an expression implicitly set to zero) which contains the first derivative of \(depvar\) wrt \(indepvar\),
\(from\) is the starting point of integration,
\(to\) is the endpoint of integration (allowed to be below \(from\)),
\(dv\) is the initial value of \(depvar\) in the point \(indepvar=from\).
The ODE \(exp\) is converted into an explicit form, which then is used for a Runge Kutta iteration over the given range. The number of steps is controlled by the value of \(i\) (default: 20). If the steps are too coarse to reach the desired accuracy in the neighborhood of the starting point, the number is increased automatically.
Result is a list of pairs, each representing a point of the approximate solution of the ODE problem.
Remarks:
Example:
depend y,x; num_odesolve(df(y,x)=y,y=1,x=(0 .. 1), iterations=5); {{x,y}, {0.0,1.0}, {0.2,1.22140275816}, {0.4,1.49182469764}, {0.6,1.82211880039}, {0.8,2.22554092849}, {1.0,2.71828182846}}
Up | Next | Prev | PrevTail | Front |