Question: Consider the linear differential equation =14(1). Write a Matlab code to plot the solution using the ode45 solver over the interval [0, 5] along with
Consider the linear differential equation =14(1). Write a Matlab code to plot the solution using the ode45 solver over the interval [0, 5] along with the vector field. If there are any fixed points, plot the line(s) representing the fixed point(s). Use two initial conditions x(0) = -0.9 and x(0) = 0.6 to plot the two solutions x(t) using solid black lines. Limit the y-axis to the interval [-1 2.5] (to prevent solutions blowing up to infinity messing the graphs). On the same figure, plot the two solutions for the same initial conditions mentioned above, but now using the Runge-Kutta method for dt = 0.1. Use here red circles to plot the data points. Hint: If f(x) = 1-x and you need to evaluate f(0.5), you can use the function feval in Matlab to do so as such f=@(x) 1-x; feval(f,0.5) *** Please help and make sure to use the feval function***
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
