File r37/lisp/csl/html/r37_0428.html artifact dfb1e84dc1 part of check-in 3c4d7b69af



<A NAME=num_odesolve>

<TITLE>num_odesolve</TITLE></A>
<b><a href=r37_idx.html>INDEX</a></b><p><p>



<B>NUM_ODESOLVE</B> _ _ _  _ _ _  _ _ _  _ _ _ <B>operator</B><P>
<P>
 
 <P>
<P>
The <em>Runge-Kutta</em> method of order 3 finds an approximate graph for 
the solution of real <em>ODE initial value problem</em>. 
 <P>
<P>
 <P> <H3> 
syntax: </H3>
<em>num_odesolve</em>(&lt;exp&gt;,&lt;depvar&gt;=&lt;start&gt;, 
 &lt;indep&gt;=(&lt;from&gt; .. &lt;to&gt;) 
 [,accuracy=&lt;a&gt;][,iterations=&lt;i&gt;]) 
<P>
<P>
or 
<P>
<P>
<em>num_odesolve</em>({&lt;exp&gt;,&lt;exp&gt;,...}, 
 { &lt;depvar&gt;=&lt;start&gt;,&lt;depvar&gt;=&lt;start&gt;,...} 
 &lt;indep&gt;=(&lt;from&gt; .. &lt;to&gt;) 
 [,accuracy=&lt;a&gt;][,iterations=&lt;i&gt;]) 
<P>
<P>
<P>
<P>
where 
&lt;depvar&gt; and &lt;start&gt; specify the dependent variable(s) 
and the starting point value (vector), 
&lt;indep&gt;, &lt;from&gt; and &lt;to&gt; specify the independent variable 
and the integration interval (starting point and end point), 
&lt;exp&gt; are equations or expressions which 
contain the first derivative of the independent variable 
with respect to the dependent variable. 
 <P>
<P>
The ODEs are converted to 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 &lt;i&gt; 
(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. 
 <P>
<P>
Result is a list of pairs, each representing a point of the 
approximate solution of the ODE problem. 
<P>
<P>
 <P> <H3> 
examples: </H3>
<P><PRE><TT>
depend(y,x);

num_odesolve(df(y,x)=y,y=1,x=(0 .. 1), iterations=5);


  ,{0.2,1.2214},{0.4,1.49181796},{0.6,1.8221064563},
    {0.8,2.2255208258},{1.0,2.7182511366}}

</TT></PRE><P>In most cases you must declare the dependency relation 
between the variables explicitly using 
<A HREF=r37_0192.html>depend</A>; 
otherwise the formal derivative might be converted to zero. 
<P>
<P>
The operator 
<A HREF=r37_0179.html>solve</A> is used to convert the form into 
an explicit ODE. If that process fails or if it has no unique result, 
the evaluation is stopped with an error message. 
<P>
<P>


REDUCE Historical
REDUCE Sourceforge Project | Historical SVN Repository | GitHub Mirror | SourceHut Mirror | NotABug Mirror | Chisel Mirror | Chisel RSS ]