Answered step by step
Verified Expert Solution
Question
1 Approved Answer
2. Consider the following system of 2 IVP-ODES: dx = y+x ' x(0) = 1 dt dy =y-x y(0) = 2 dt for t
2. Consider the following system of 2 IVP-ODES: dx = y+x ' x(0) = 1 dt dy =y-x y(0) = 2 dt for t [0,2]. (a) Solve this problem analytically and show that the anaytical solu- tion reads as follows: x(t) e(cos(t) + 2sin(t)) = y(t) = e(-sin(t) + 2cos(t)) (b) Write a Matlab function to solve a system of ODEs using 1st order accurate Euler's explicit method. Call it EulerSYS_10DE.m. Test your function on this system with At = 0.5. Compute the relative error to the exact solution for x(t) and y(t) at t = 2. (c) Solve this problem numerically using 4th order accurate Runge- Kutta method RK4SYS_10DE.m developed in class with At = 0.5. Compute the relative error to the exact solution for x(t) and y(t) at t = 2. (d) Plot the 3 solutions (analytical, 1st order Euler and 4th order Runge-Kutta) for x(t) and y(t) on a single figure. Hand all your commented Matlab codes, the computed errors and the figure.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started