Home > K25104 > ODEs > implicit_multistep_script_2.m

implicit_multistep_script_2

PURPOSE ^

Usage example for implicit_multistep

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 Usage example for implicit_multistep
 employing 3-step Adams-Moulton method

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % Usage example for implicit_multistep
0002 % employing 3-step Adams-Moulton method
0003 
0004 f = @(t,y) -10^2*(y - t^(-1)) - t^(-2);
0005 t0 = 1;
0006 y0 = 1;
0007 h = 0.1;
0008 T = 2;
0009 rho = [0; 0; -1; 1];
0010 sigma = [1/24; -5/24; 19/24; 3/8];
0011 analytic = @(t) t.^(-1);
0012 [ y,t,err ] = implicit_multistep( f,t0,y0,h,T,rho, sigma, analytic );
0013 figure;
0014 plot(t,y,'o');           
0015 xlabel('t');
0016 ylabel('y(t)');
0017 hold on;
0018 ezplot(analytic, [1 2]);
0019 legend('numerical','analytic');

Generated on Mon 18-Jan-2016 10:25:49 by m2html © 2005