©
A 2.nd order ODE prototype
Solves a 2.nd order ODE prototype with known solution, numerically.
2024.Jul.03 12:30:39
Initial values x and x' for t = 0. •
k s−2 A given parameter, k. •
h s Numerical integration step (e.g., seconds).
Final time s Final time of integration. •
Show values Show the graph coordinates.

Solves a higher (2.nd) order ordinary differential equation (ODE) with known solution,

x = cos(kt ²) + at + b
x' = −2kt sin(kt ²) + a
x" = −2k sin(kt ²) − 4k ²t ² cos(kt ²)

proposed for resolution as

x" = −2k sin(kt ²) − 4k ² (xat - b) t ²

with (necessarily)  x(0) = b + 1 and x'(0) = a, by the (usual) Runge-Kutta 4.th order method.

The independent variable is t. The two initial values are supposed given. The equation is converted into an equivalent system of first order equations, as is typically recommended.

Important  The RK4 (4.th orderRunge-Kutta) method supplies all the derivatives, up to n − 1, besides the desired (numerically) integrated function. So, in this example of a 2.nd order ODE (n = 2), the method supplies n functions: the function itself (derivative of order 0), x(t); and the 1.st derivative (derivative of order 1), x'(t).

Draws graphs for: x and x', where the numerical and analytical solutions are superimposed; and x", known analytical.

(This webpage is in version 2.)

References: Plate: ODEprototype

• Wikipedia: Numerical methods for ordinary differential equations

• 1814-09-03: Sylvester, James Joseph († 1897-03-15).

 
 
Valid HTML 4.01! IST http://web.tecnico.ulisboa.pt/~mcasquilho/compute/com/Fx-ODE2prototype.php
Created: 2018-09-03 — Last modified: 2018-10-25