Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please write MATLAB CODE FOR THIS 4. Consider the IVP: y=0.5y,y(0)=1;0t6 (a) Determine the Improved Euler's approximation for N=60,N=600 and N=6000. Fill in the following

please write MATLAB CODE FOR THIS image text in transcribed
image text in transcribed
4. Consider the IVP: y=0.5y,y(0)=1;0t6 (a) Determine the Improved Euler's approximation for N=60,N=600 and N=6000. Fill in the following table with the values of the approximations, errors and ratios of consecutive errors at t=6. Two values have already been entered to help you check your results. Recall that the exact solution to the ODE is y(t)=e0.5t. Include the table in your report, as well as the MATL AB commands used to find the entries. (b) Examine the last column. How does the ratio of the errors relate to the number of steps used? Your answer to this question should confirm the fact that Improved Euler's method is a "second-order" method. That is, every time the step size is decreased by a factor k, the error is reduced (approximately) by a factor of k2. Note: Since Euler's method is only of the 1st order, the Improved Euler's method is more efficient (hence the "improved"). function [t,y]= impeuler (f,tspan,y,N) \% Solves the IVP y=f(t,y),y(t)=y in the time interval tspan =[t,tf] % using Euler's method with N time steps. \% Input:| \% f= name of inline function or function M-file that evaluates the ODE (if not an inline function, use: euler(@f,tspan, y,N) ) \% For a system, the f must be given as column vector. % yo = initial value of the dependent variable. If solving a system, \% initial conditions must be given as a vector. \% N= number of steps used. % Output: %t= vector of time values where the solution was computed %y= vector of computed solution values

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advanced Database Systems

Authors: Carlo Zaniolo, Stefano Ceri, Christos Faloutsos, Richard T. Snodgrass, V.S. Subrahmanian, Roberto Zicari

1st Edition

155860443X, 978-1558604438

More Books

Students also viewed these Databases questions