Question: Code in MATLAB. Consider the following ODE: d x d t = e x - c o s ( x ) Complete the following tasks:

Code in MATLAB. Consider the following ODE:
dxdt=ex-cos(x)
Complete the following tasks:
a. Plot dxdt vs. x over a range of x values from -6 to 2.
b. Annotate this plot (by hand) to complete a phase portrait, i.e. identify the fixed points and classify their stability.
c. Sketch (by hand) the anticipated solution, x(t), for an initial value of x=-2.
d. Solve this ODE using MATLAB's ode45() function for an initial value of x=-2 and a range of time (t) values from 0 to 10.
e. On a new figure, plot your solution, x vs t.
f. Briefly describe how your answers to Parts (c) and (d) compare.
Code in MATLAB. Consider the following ODE: d x d

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mechanical Engineering Questions!