Relative Stabilities of Forward Euler, Improved Euler and Runge-Kutta Methods

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

Relative Stabilities of Forward Euler, Improved Euler and RungeKutta Methods

>> plot(x,1+x,'g',x,1+x+0.5*x.^2,'b');
>> title('Stability intervals');
>> xlabel('hx');
>> legend('Forward Euler Method','Improved Euler');
>> hold on;
>> plot([-2],[-1:0.1:1],'r:',[0],[-1:0.1:1],'r:',[-2:0.1:0],[-1],'r:')
>> x=-3:0.01:1;
>> plot(x,1+x,'r',x,1+x+0.5*x.^2,'g',x,1+x+0.5*x.^2+(1/6)*x.^3+(1/24)*x.^4,'b');
>> title('Stability Intervals');
>> xlabel('h/lambda');
>> ylabel('f(h/lambda)');
>> legend('Forward Euler Method','Improved Euler Method','RK4');

You might also like