Use Matlab program to solve the following first order OOE by

Use Matlab program to solve the following first order OOE by the following Numerical Methods Euler Heun (single iteration) 2^nd Order Midpoint Runge-Kutta (R-K) 2^nd Order Ralston Runge-Kutta (R-K). Vary the step size, h = Delta x = 0.2.0.1 and 0.01 over 0 lessthanorequalto x lessthanorequalto 2 Initial condition. y(x=0) = 1 dy/dx = yx^2 - 1.2 y Obtain the closed form or analytical solution of above first ODE Calculate the % numerical error. E_t m Matlab based on analytical solution Your Matlab program must be able to plot the results for all the 4 numerical methods, analytical solution in one sub-plot window and % numerical errors (in another split sub-plot window). when h = 0.2.0.1 and 0.01 over 0 lessthanorequalto x lessthanorequalto 2 Plots windows for different h values should follow one after another with pause command and click of user and with proper label for h values in each window s title You can spM the plot window into two vertical halves Submit the digital copies of your Matlab programs In iLearn dropbox by 11/23 midnight. Submit the digital copies of your Matlab plots In iLearn dropbox (by 11/23 midnight) for all the 4 numerical methods, analytical solution and % numerical errors. E.. when h = 0.2.0.1 and 0 01 over 0 lessthanorequalto x lessthanorequalto 2 in part above.

Solution

Eulers method

Given that dy/dx = (yx2- 1.2y)

   let f(x,y)= yx2-1.2y h=0.01

and y(0) =1 => x0=0, y0=1

x1=x0+h= 0+0.01=0.01

y1=y0+hf(x0,y0)

=1+(0.01)(0-1.2)

y(0.01) =0.988

now we cosider h=0.1 to compute y(0.1), y(0.2)

iteration 1) f(x,y) = yx2-1.2y, x0=0, y0=1, h=0.1

x1=x0+h=0+0.1=0.1

y1=y0+hf(x0,y0)

=1+(0.1)(-1.2(1))

y(0.1) =0.88

iteration2) x2=x1+h=0.1+0.1=0.2, y1=0.88

y2=y1+hf(x1,y1)

=0.88+(0.2)((0.88)(0.1)2-(1.2)(0.88))

=0.88+(0.2)(-1.0472)

=0.88-0.209

y(0.2) =0.671

 Use Matlab program to solve the following first order OOE by the following Numerical Methods Euler Heun (single iteration) 2^nd Order Midpoint Runge-Kutta (R-K

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site