Sharp Ordinary Differential Equations, Calculation, EL-9900 Graphing Calculator, Flowchart

Models: EL-9900

1 38
Download 38 pages 46.35 Kb
Page 27
Image 27
Ordinary Differential Equations

EL-9900 Graphing Calculator

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.

Manual background 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) (K0-2Q0), Y (1)= Yn +R1

2.Q1 = Q0 + 3R1- (1/2)K0

K1 = Hf (Xn + H/2, Y(1)), R2 = (1 - 1/2) (K1-Q1), Y(2)=Y(1)+ R2

Y3

 

 

 

3. Q2 = Q1 + 3R2 - (1 -

K1

Y2

 

 

 

 

 

 

 

 

K2

= Hf (Xn + H/2, Y(2)), R3 = (1 + 1/2) (K2 -Q2),Y(3)= Y(2)+ R3

Y1

 

 

 

4. Q3

= Q2 + 3R3- (1 + 1/2) K2

 

 

h

h

 

 

 

 

X

K3

= Hf (Xn+1, Y(3)), R4 = (1/6) (K3-2Q3), Yn+1 = Y(3)+ R4

0

X1

X2 X3

Q4

= Q3 + 3R4 - (1/2)K3

 

 

 

 

 

 

FLOWCHART

Start

Entry of data

Initial setting

MAIN

Gosub

Manual background 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 Manual background Subroutine for

calculating built-in function

Return

Subroutine for calculating built-in function

f = -I J

(Another equation can be used.)

Manual background Calculation of step 2.

Gosub

Manual background 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 ZI Goto SUB2

Print " Input Y0

H F K

I M

Manual background 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 (K-Q) R

 

J

N

X

I

 

 

J+R

J

 

Label SUB1

Y

J

 

 

Q+3

R-B K Q

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

(K-Q) R

 

Print N

1+

(2-1) A

 

J+R

J

 

Wait

1-

(2-1) B

 

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

(Z-S) (J-O) /H+O P

Gosub FORMULA

J+R

J

 

Z

M

H F

K

 

Q+3

R - K/2

Q

P

N

(K-2

Q) /2

R

If ZI Goto NEXT

Goto SUB1

J+R

J

 

I

S

 

 

Label FORMULA

Q+3 R-K/2

Q

J

O

 

-I J F

 

 

 

 

 

 

 

 

Return

20

Page 27
Image 27
Sharp Ordinary Differential Equations, Calculation, EL-9900 Graphing Calculator, Flowchart, Programme Listreal Mode