Question: ( a ) Modify the function ex _ with _ 2 eqs to solve the IVP ( 4 ) for 0 t 6 0 using
a Modify the function exwitheqs to solve the IVP for using the MATLAB
routine ode Call the new function LABex
Let note the upper case be the output of ode and and the unknown functions.
Use the following commands to define the ODE:
function
;;
;;
Plot and in the same window do not use subplot and the phase plot showing vs
in a separate window.
Add a legend to the first plot. Note: to display use
Add a grid. Use the command ylim to adjust the limits for both plots. Adjust
the limits in the phase plot so as to reproduce the pictures in Figure Figure : Time series and left and phase plot vs for
b By reading the matrix and the vector find approximately the last three values of in
the interval at which reaches a local maximum. Note that, because the Mfile
LABexm is a function file, all the variables are local and thus not available in the Command
Window. To read the matrix and the vector you need to modify the Mfile by adding the
line ::
Do not include the whole output in your lab writeup Include only the values necessary to
answer the question, ie just the rows of with local maxima and the adjacent
rows. To quickly locate the desired rows, recall that the local maxima of a differentiable
function appear where its derivative changes sign from positive to negative. Note: Due to
numerical approximations and the fact that the numerical solution is not necessarily computed
at the exact values where the maxima occur, you should not expect to be exactly
at local maxima, but only close to
c What seems to be the long term behavior of
d Modify the initial conditions to and run the file LABexm with
the modified initial conditions. Based on the new graphs, determine whether the long term
behavior of the solution changes. Explain. Include the pictures with the modified initial
conditions to support your answer.;;;;
;;;;
ode@;
:;:; y in output has columns corresponding to and
figure;
subplot; plottub; ylabelu;
subplot; plotturo; ylabelu;
figure
plotuu; axis square; xlabelu; ylabelu; plot the phase plot
function
;;
dydt ;;
endfunction exwithparam
;;;
;
ode@;
num end
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
