Runge-Kutta method: Difference between revisions
Content added Content deleted
m (→{{header|REXX}}: used HTML to render the equations.) |
|||
Line 2,863: | Line 2,863: | ||
=={{header|REXX}}== |
=={{header|REXX}}== |
||
<pre> |
|||
The Runge─Kutta method is used to solve the following differential equation: |
|||
|
|||
<big><big> y'(t) = t<sup>2</sup> √<span style="text-decoration: overline"> y(t) </span></big></big> |
|||
|
|||
The exact solution: <big><big> y(t) = (t<sup>2</sup>+4)<sup>2</sup> ÷ 16 </big></big> |
|||
╔═══════════════╗ ______ ╔══ the exact solution: y(t)= (t²+4)²/16 ══╗ |
|||
╚═══════════════╝ y'(t)=t² √ y(t) ╚═══════════════════════════════════════════╝ |
|||
</pre> |
|||
<lang rexx>/*REXX program uses the Runge─Kutta method to solve the equation: y'(t) = t² √[y(t)] */ |
<lang rexx>/*REXX program uses the Runge─Kutta method to solve the equation: y'(t) = t² √[y(t)] */ |
||
numeric digits 40; f= digits() % 4 /*use 40 decimal digs, but only show 10*/ |
numeric digits 40; f= digits() % 4 /*use 40 decimal digs, but only show 10*/ |