![Ordinary Differential Equations](/images/new-backgrounds/123574/12357453x1.webp)
Ordinary Differential Equations
Enter the initial conditions (X, Y) with the step H and interval T. Use Runge Kutta Gill method to solve the ordinary differential equation of first order.
Calculation
Use the following four steps of Runge Kutta Gill method to find the equation Xn + 1 and Yn - 1 from Xn and Yn. Input Qo = 0 at the
starting point X0. | Y |
1.K0 = Hf (Xn , Yn), R1 = (1/2)
2.Q1 = Q0 + 3R1- (1/2)K0
K1 = Hf (Xn + H/2, Y(1)), R2 = (1 - 1/2) | Y3 |
|
|
| |||
3. Q2 = Q1 + 3R2 - (1 - | K1 | Y2 |
|
|
| ||
|
|
|
|
| |||
K2 | = Hf (Xn + H/2, Y(2)), R3 = (1 + 1/2) (K2 | Y1 |
|
|
| ||
4. Q3 | = Q2 + 3R3- (1 + 1/2) K2 |
|
| h | h | ||
|
|
|
| X | |||
K3 | = Hf (Xn+1, Y(3)), R4 = (1/6) | 0 | X1 | X2 X3 | |||
Q4 | = Q3 + 3R4 - (1/2)K3 |
|
|
|
|
|
|
FLOWCHART
Start
Entry of data
Initial setting
MAIN
Gosub
Calculation of step 1.
Gosub
Enter Data.
Initial coordinates (X, Y), step
of x (H), and interval of solutions (T) Data for calculation set.
Calculation executed.
Jumps to subroutine.
Jumps to subroutine.
Subroutine
FORMULA Subroutine for
calculating
Return
Subroutine for calculating
f =
(Another equation can be used.)
Calculation of step 2.
Gosub
Calculation of step 3.
Gosub
Jumps to subroutine.
Jumps to subroutine.
PROGRAMME LIST(REAL MODE)
Title : RUNGE
Rem INITIAL | I+H/2 I | Goto MAIN |
Print " Input X0 | Rem 2 | Label NEXT |
Input X | Gosub FORMULA | If Z≠ I Goto SUB2 |
Print " Input Y0 | H F K | I M |
Calculation of step 4.
| N | Judgment of calculation end. |
| ||||
Z <= I | If calculation result of I smaller |
| |||||
|
| ||||||
Y |
| than value of increase of I, |
| ||||
| calculation repeated again. |
| |||||
S = I |
|
|
|
|
|
| |
O = J |
|
|
|
|
|
| |
Z ≠ I | N |
| Following calculation |
| |||
SUB2 | performed when calculation | ||||||
Y | |||||||
Processing | result of x not equal to the | ||||||
| value of increase of X. |
| |||||
| in case of |
| (Z - S) (J - O) |
| M = Z | ||
| inequality | P = | + O, | ||||
|
|
| H | N = P | |||
|
|
|
|
|
|
SUB1
Display of result
| Processing for | Prior processing for next calculation | |
| next calculation | Z = Z + T, S = X, O = J | |
|
|
|
|
Input Y |
| B |
| J | N | ||||
X | I |
|
| J+R | J |
| Label SUB1 | ||
Y | J |
|
| Q+3 | ClrT | ||||
Print " Input H | Rem 3 |
| Print "XN= | ||||||
Input H |
| Gosub FORMULA | Print M | ||||||
Print " Input T | H | F | K |
| Print "YN= | ||||
Input T |
| A |
| Print N | |||||
1+√ |
| J+R | J |
| Wait | ||||
1- √ |
| Q+3 | R - A K Q | Z+T Z | |||||
I+T |
| Z |
| I+H/2 I |
| I | S | ||
O | Q |
| Rem 4 |
| J | O | |||
I S |
|
| Gosub FORMULA | Goto MAIN | |||||
Label MAIN |
| H F | K |
| Label SUB2 | ||||
Rem 1 |
| (K - 2 Q) /6 | R | ||||||
Gosub FORMULA | J+R | J |
| Z | M | ||||
H F | K |
| Q+3 | R - K/2 | Q | P | N | ||
Q) /2 | R | If Z≤ I Goto NEXT | Goto SUB1 | ||||||
J+R | J |
| I | S |
|
| Label FORMULA | ||
Q+3 | Q | J | O |
| |||||
|
|
|
|
|
|
|
| Return |
20