We wisth to approximate the solution to a first order differential equation given by
dux)/ck =ypx) =f(x)x), with y(xo)=vo
To compute successive approximations ], :12:],to the (true) values )(x,). y(x,),y(x;)... of
the exact solution y - y(x) at the points XXX,, respectively.
In plain English:
Runge-Kutta is iterative, based on the weighted average of 4 slopes, the calculated * values.
Jan - 1 + (AV).
That is.
(47), - =(4 + 21, + 21, + 1. ).
You want to approximate the value of = (ory') at some point in an interval.
Step 0: Depending on how accurate you need to be, divide the interval up into little pieces of
equal length; this length is the step size h. At each iteration, the next value for y is the current
value + weighted average of the *'s from the current step.
Step 1: Calculate the following quantities, the *'s referred to above.
t - f ( + - hy, + = )h
Step 2: Calculate (Ay) - =(1 + 28, + 28, + 1,)
Step 3: Calculate ], - 7, + (AV)
Step 4: Go to step 1, incrementing the subscripts on x and y by 1. Continue until the desred level
of accuracy is obtained. |
Exercises
Use the Runge-Kutta Method with step size: h =0.1,0.02, (that is, do the problem 2 times, each
With a more precise value of h) 10 equally spaced iterations.
1. p-x+y: "(0) - 0,05x51
3. y'- hy, "(1) - 2,1852
2. "'-x - y : "(0) -1,05x52
4. y"-x+y
: 70) - 1,05x52