MAT275_LAB3

# MAT275_LAB3 - Exercise 1 part a N Approximation error ratio...

• Lab Report
• 12

This preview shows page 1 - 7 out of 12 pages.

Exercise 1 part a) N Approximation error ratio 5 7.4650 .6899 0 50 8.0748 .0801 8.6148 500 8.1467 .0081 9.8381 5000 8.1540 .00081 9.9835 Exercise 1 part b) When the step size is increased by a factor of 10, the error decreases by a factor of 10. Exercise 1 part c) Because Euler’s method uses the slope at a point, followed by another slope of that slope, the discrepancies between the actual value and the predicted value add up, creating a lower value than the actual value. Exercise 2 part a)

Subscribe to view the full document.

Exercise 2 part b) Exercise 2 part c)
Exercise 2 part d) The two graphs seem almost opposite in appearance. The first graph with 8 steps appears to start closer to the actual value and diverge farther and farther from the actual value. For the second graph the fit is almost a perfect match for the actual values. Exercise 3

Subscribe to view the full document.

Exercise 4 part a) N approximation error ratio 5 8.1081 .0467 0
50 8.1453 5.3555*10^-4 87.2394 500 8.1458 5.4284*10^-6 98.6567 5000 8.1458 5.4357*10^-8 99.8650 Exercise 4 part b) As the error decreases, the power the error has decreases by 2, proving that improved euler’s method reduces error by h^2. Exercise 5 part c) Exercise 5 part d)

Subscribe to view the full document.

% Patrick Hayes % MAT 275 LAB 3 % Numerical Solutions by Euler and Improved Euler Methods % MWF 7:30-8:20 clc clear all close all %% Exercise 1 % Part A) f= inline('2*y', 't', 'y'); t= linspace(0, .5, 100); %defines the exact solution of the ode y= 3*exp(2*t); %defines the exact solution for exact solution of the ODE [t50,y50]= euler(f, [0,.5], 3, 50); %solves the ODE using Euler with 50 steps [t5,y5]= euler(f, [0,.5], 3, 5); % solves for the ODE using Euler with 5 steps [t500,y500]= euler(f, [0,.5], 3, 500); % solves the ODE using Euler with 500 steps [t5000,y5000]= euler(f, [0,.5], 3, 5000); % solves the ODE using Euler with 5000 steps plot(t5,y5,'ro-',t50,y50,'bx-',t,y,'k-'); axis tight;

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern