Home > K25104 > ODEs > RK_stab_fun_script_2.m

RK_stab_fun_script_2

PURPOSE ^

Usage example for RK_stab_fun

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 Usage example for RK_stab_fun
 Boundary of stability domain of the original Runge-Kutta method

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % Usage example for RK_stab_fun
0002 % Boundary of stability domain of the original Runge-Kutta method
0003 
0004 b = [1/6; 1/3; 1/3; 1/6];
0005 c = [0; 1/2; 1/2; 1];
0006 A = [0 0 0 0;
0007     1/2 0 0 0;
0008     0 1/2 0 0;
0009     0 0 1 0];
0010 [ R ] = RK_stab_fun( b,c,A )
0011 [X,Y] = meshgrid(-3:0.1:0.5,-3.5:0.1:3.5);
0012 Z = X+1i*Y;
0013 Rmod = abs(R);
0014 Rmod = matlabFunction(Rmod);
0015 boundary = feval(Rmod,Z);
0016 contour(X,Y,boundary,[1 1]);
0017 grid on;
0018 title(['original Runge-Kutta method']);

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