Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

initial _ x = 1 ; initial _ dxdt = 0 ; t _ span = [ 0 5 ] ; [ t , x

initial_x=1;
initial_dxdt=0;
t_span=[05];
[t,x]=ode45(@(t,x) odesecondorder(t,x,1,1,25),t_span,[initial_x initial_dxdt]);% m=1,b=1,k=25
plot(t,x(:,1));
xlabel('t');ylabel('x');
hold on;
[t,x]=ode45(@(t,x) odesecondorder(t,x,1,10,25),t_span,[initial_x initial_dxdt]);%m=1,b=10,k=25 plotted as dashed line
plot(t,x(:,1),'--')
[t,x]=ode45(@(t,x) odesecondorder(t,x,1,11,25),t_span,[initial_x initial_dxdt]);%m=1,b=11,k=25 plot color yellow
plot(t,x(:,1));
hold off;
function dxdt=odesecondorder(t,x,m,b,k)
dxdt_1=x(2);
dxdt_2=-(b*x(2)+k*x(1))/m;
dxdt=[dxdt_1;dxdt_2];
end

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Use a three-step process to develop effective business messages.

Answered: 1 week ago