Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need some help in matlab to solve this differential equation. I have a code but I need to fix it. I have wrote this
I need some help in matlab to solve this differential equation. I have a code but I need to fix it.
I have wrote this code, But I can't get the problem
Using Euler integration solve the following: 1. 2. Create a spreadsheet to integrate x = Cos(k t) where initial X = x, Use the following: a. At = 0.005, x, = 1, k = 2 1, determine the value of x when t = 2.5 b. At = 0.005, x, = 2, k = 41, determine the value of x when t = 2.5 t = 0.01, x, = 3, k = n, determine the value of x when t = 2.5 For the values in 2a, plot x on vertical and time on horizontal. a. Change the At from 0.005 up to 1. Observe what happens to the graph. c. 3. 1 . 2 i Aw 11 6 deltaT = .5; initialxyz = [1 2 3]; %freg = 3 * pi(); endTime = 5; initialTime = 0; %timeRange [initialTime endTime]; % timeRange = 0:deltat:endTime; stuffForTheDot = [1]; https://www.mathworks.com/help/matlab/math/choose-an-ode-solver.html (theTime, theX] = ode 45 (@(tt, yy) getTheDot (tt,yy, stuffForTheDot), ... timeRange, initialxyz, ... %deltat, stuffForTheDot); plot (theTime, theX); ylim ( [0 2.5]); 8 - 9 10 - 11 12 13 14 - 15 16 17 18 19 III III. function theDotIs = getTheDot (time, x, stuff) thex = x(1); they = x(2); theZ = x(3); xdot = -theX + TheY - cosd (3*time); they = xdot -ydot; zdot = -TheZ + theY; 20 - 21 22 23 24 the DotIs = [xdot; ydot; zdot]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