Question & Answer: Complete the MATLAB functions to plot the solutions for x(t) and x'(t) of this system for 0 lessthanorequalto t lessth…..

Complete the MATLAB functions to plot the solutions for x() and x (0 of this system for osts 1 using MATLAB ode 45. Function FinalProbien will do the plotting, and has no input or output arguments Function eyode will contain the system of ode to be used by ode45. Fill in the input and output arguments for this function (14 pts) From MATLAB help: [TOUT, YOUT] - ode45(ODEFUN, TSPAN, YO) with TSPAN- tro trisALI function FinalProblem end function myode( end Page N7:

PLEASE SHOW CLEAR WORK .. THANK YOU ..

Don't use plagiarized sources. Get Your Custom Essay on
Question & Answer: Complete the MATLAB functions to plot the solutions for x(t) and x'(t) of this system for 0 lessthanorequalto t lessth…..
GET AN ESSAY WRITTEN FOR YOU FROM AS LOW AS $13/PAGE
Order Essay

Complete the MATLAB functions to plot the solutions for x(t) and x'(t) of this system for 0 lessthanorequalto t lessthanorequalto 1 using MATLAB ode45. Function Final Problem will do the plotting. and has no input or output arguments. Function myode will contain the system of ode to be used by ode45. Fill in the input and output arguments for this fraction. x = -2x – (6x^3 + 4x): x(0) = 1, x(0) = 0 From MATLAB help: [TOUT, YOUT] = ode45 [ODEFUN, TSPAN, Y0] with TSPAN = [T0 TFINAL] function Final Problem end function myode() end

Expert Answer

 

As per the given euation:-

x= -2x -(6×3+4x);

x(0) = 1, x'(0) = 0

let x1 = y and x2 = y’

So, x1‘ = x2

& x2‘ = -2x2 -(6x13+4x1)

Here is the matlab code segment:-

%%=================================

function dydt=myode(t,y)

dydt = [y(2); (6*y(1)^3)-4*y(1)];

end

function Finalfunction

[t,y]=ode45(‘myode’,[0,1],[1,0]);

subplot(2,1,1);

plot(t,y(:,1),’r’);

grid on;

title(‘Subplot 1: dydt vs time’)

xlabel(‘dydt’) % x-axis label

ylabel(‘Flow’) % y-axis label

subplot(2,1,2);

plot(t,y(:,2),’r’);

grid on;

title(‘Subplot 2: y vs time’)

xlabel(‘y’) % x-axis label

ylabel(‘time’) % y-axis label

end

%==================================

Please run these codes into your matlab window and checkout the output.

Still stressed from student homework?
Get quality assistance from academic writers!