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

MATLAB must be used. Please help! Write a code that uses Euler\'s forward method

ID: 3773109 • Letter: M

Question

MATLAB must be used. Please help!

Write a code that uses Euler's forward method to integrate in time the equation Use a step size Deltat = 0.1 to start with and plot the resulting numerical values versus the exact solution for t [0,15]. Repeat the same computation and the pertaining plot for Deltat = 0.01 and Deltat = 1.0. Now modify your Euler code to turn it into the classical Runge-Kutta fourth-order method and apply it to the case of a system of four equations with four unknowns. Thus, solve the system du/dt = cos(t), w(0) = 0. subject to the initial conditions x(0) = - 1, y(0) = 4, u(0) = 1, v(0) = 1. Use a step size At = 0.01 and plot the values of the four variables as a function of time, each on a different plot, up to t = 15. Also plot u(t) versus x(t) for the same range in t.

Explanation / Answer

MATLAB must be used. Please help! Write a code that uses Euler's forward method