Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

can be done in any of the following: c/c++/python/matlab... Consider the initial

ID: 3719571 • Letter: C

Question

can be done in any of the following: c/c++/python/matlab...

Consider the initial value problem:

dy(t)/dt = 0.3 ? 0.1y(t), 0 ? t ? 1

y(0) = 0.

(a) Find the exact solution.

(b) Write a code to implement Euler’s method. As output, your code should provide the approximation Wi to the solution y(Ti) at each step of the algorithm. Use your code to find an approximation for y(1) with h = 0.2.

(c) Modify your code to implement Runge Kutta Method of order 4. Use step size h = 0.2.

(d) Compare these approximations for y(1) with the exact solution at t = 1 and comment about the relative accuracy, by computing the relative errors

Yappror - Yeract Yeract

Explanation / Answer

% [t, y]=EULER_forward_ODE(f, t0, y0, tend, Niter)
% Euler forward approximation method to solve Initial Value Problem
% f defines the function f(t,y)
% t0 defines initial value of t
% y0 defines initial value of y

c)

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at drjack9650@gmail.com
Chat Now And Get Quote