Runge-Kutta method: Difference between revisions
m
→{{header|Mathematica}}
m (→{{header|REXX}}: used HTML to render the equations.) |
|||
Line 1,989:
</pre>
=={{header|Mathematica}}/{{header|Wolfram Language}}==
<lang Mathematica>(* Symbolic solution *)
DSolve[{y'[t] == t*Sqrt[y[t]], y[0] == 1}, y, t]
Line 2,009:
solution = NestList[phi, {0, 1}, 101];
Table[{y[[1]], y[[2]], Abs[y[[2]] - 1/16 (y[[1]]^2 + 4)^2]},
{y, solution[[1 ;; 101 ;; 10]]}]
=={{header|MATLAB}}==
|