# System of Two Differential Equations, Runge Kutta 4th Order

Casio fx-9750GIII and fx-CG50: System of Two Differential Equations, Runge Kutta fourth Order

Presentation

The program TWORK4 utilizations the Runge Kutta fourth Order strategy to illuminate the accompanying arrangement of differential conditions:

dx/dt = f(t, x, y)

dy/dt = g(t, x, y)

with beginning conditions x0 = x(t0) and y0 = y(t0)

The subsequent stage is determined with step h from:

x1 ≈ x0 + (k1 + 2 * k2 + 2 * k3 + k4)/6

y1 ≈ y0 + (l1 + 2 * l2 + 2 * l3 + l4)/6

k1 = h * f(t0, x0, y0)

l1 = h * g(t0, x0, y0)

k2 = h * f(t0 + h/2, x0 + k1/2, y0 + l1/2)

l2 = h * g(t0 + h/2, x0 + k1/2, y0 + l1/2)

k3 = h * f(t0 + h/2, x0 + k2/2, y0 + l2/2)

l3 = h * g(t0 + h/2, x0 + k2/2, y0 + l2/2)

k4 = h * f(t0 + h, x0 + k3, y0 + l3)

l4 = h * g(t0 + h, x0 + k3, y0 + l3)

For the following stage set t0 = t0 + h, x0 = x1, and y0 = y1.

Information sources:

DX/DT:  Enter dx/dt as an element of T, X, and Y.   T is the autonomous variable.

DY/DT:  Enter dy/dt as an element of T, X, and Y.   T is the free factor.

T0, X0, Y0:  Enter the underlying conditions

STEP:  Enter the progression size

Cycles: Enter the quantity of emphasess desired.  This permits you to compute a far point in one leap.  Example, if your underlying condition is to = 0 and you need to discover the moment that t = 1 utilizing the progression size of 0.1, enter 0.1 for STEP and 10 for ITERATIONS.

Casio fx-9750GIII and fx-CG 50 Program: TWORK4

Notes:

*  Although the code for the two adding machines are the equivalent, the projects should be modified on every number cruncher independently.

*  The slice character (/) is gotten to from the CHAR submenu.  The submenu appears at the high level menu which would peruse:

* fn1 and fn2 are put away as capacity recollections.

“2020-06-18 EWS”

“DX/DT=”? → fn1

“DY/DT=”? → fn2

“T0”? → U

“X0”? → A

“Y0”? → B

“STEP?” → H

4 → Dim List 25

4 → Dim List 26

Lbl 0

“Emphasess”? → N

For 1 → I To N

A → X: B → Y: U → T

H * fn1 → List 25

H * fn2 → List 26

A + List 25 ÷ 2 → X

B + List 26 ÷ 2 → Y

U + H ÷ 2 → T

H * fn1 → List 25

H * fn2 → List 26

A + List 25 ÷ 2 → X

B + List 26 ÷ 2 → Y

H * fn1 → List 25

H * fn2 → List 26

A + List 25 → X

B + List 26 → Y

U + H → T

H * fn1 → List 25

H * fn2 → List 26

A + (List 25 + List 25 + Sum List 25) ÷ 6 → A

B + (List 26 + List 26 + Sum List 26) ÷ 6 → B

U + H → U

Next

ClrText

“(T, X, Y)”

{U, A, B} ◢

Menu “NEXT?”, “YES”, 0, “NO”, 1

Lbl 1

“DONE”

Model

dx/dt = x sin y

dy/dt = y^2/500 + y/3 – y

Beginning conditions: x(0) = 0.1, y(0) = 0.1, h = 0.1

T0 = 0

STEP = 0.1

Emphasess: 10

Results:  (T, X, Y): (1, 0.1075645239, 0.05134921355)

Emphasess: 10

Results:  (T, X, Y): (2, 0.1116714419, 0.02636554462)