Question: EXERCISES 3 . Modify the M - file euler.m to implement the algorithm for Improved Euler. Call the new file impeuler.m ( include the file

EXERCISES
3. Modify the M-file euler.m to implement the algorithm for Improved Euler. Call the new file
impeuler.m (include the file in your report).
Test your code for the IVP y=0.5 y, y(0)=4, in the interval [0,2.25], using N =9 steps.
First enter the function f (t, y)=0.5 y as anonymous function and then enter the following:
>>[ t9, y9]= impeuler (f ,[0,2.25],-4,9); % use @ f if defined in separate m - file
>>[ t9, y9]
ans =
0-4.0000
0.2500-4.5312
0.5000-5.1331
0.7500-5.8148
1.0000-6.5871
1.2500-7.4619
1.5000-8.4529
1.7500-9.5756
2.0000-10.8474
2.2500-12.2880
Compare your output with the one above. You should obtain the same values

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!