Predictor-Corrector Method for a First Order Equation
This program computes the solution Y(X) of the ordinary differential equation using the Adams Baskfort and Adams-Moulton methods:
dy(x)/dx = f(x,y) for: a < x< b given the initial condition::
y (a) = ya
Program Notes
In order to use this program you will need to provide the following information:
* Define the functionf( x,y ) using a Function FNF(x,y) = statement located at end of program.
* Specify the input step size.
* Define a tolerance for the local error.
* Specify the maximum number of correction cycles to be run.
Example
Solve the equation:
dy/dx = f(x,y) = x+y in the interval: (0,1)
for the initial condition, y(0) = 0
Downloads:
basic program - liberty basic - lbpcmfoe.bas
Test case:
PREDICTOR-CORRECTOR METH0D FOR A FIRST ORDER EQUATION
ENTER INTERVAL OF INTEGRATION
A = 0 B = 1
INITIAL CONDITION
YA = 0
WANT STEPSIZE CONTROL (Y/N) ?N
INITIAL STEPSIZE
H = .25
TOLERANCE OF LOCAL ERROR X AS IN 1e-X = 7
MAXIMUM NUMBER OF
CORRECTION CYCLES ?3
SOLUTION ********
X = 0.25 Y =0.34016927e-1 X = 0.5 Y =0.14869947 X = 0.75 Y =0.36695803
|