Question: help plot acceleration Vs time in matlab. below are the given codes. %code function Xt=LumpFun(t,X) Xt=zeros(2,1); c=1.0; k=2.0; m=5.0; F=0.; %what would X(3) be needs

help plot acceleration Vs time in matlab. below are the given codes.

%code

function Xt=LumpFun(t,X) Xt=zeros(2,1); c=1.0; k=2.0; m=5.0; F=0.; %what would X(3) be needs to equal acceleration - acceleration is the %second derivitave of velocity Xt(2)=-(c/m)*X(2)-(k/m)*X(1)+(F/m); %Velocity Xt(1)=X(2); %Displacement end

X_init=[1,0]; t_min=0; t_max=50; t_range=[t_min, t_max]; [t,X]=ode45(@LumpFun, t_range, X_init); % plot to get acceleration vs time

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 Databases Questions!