third order differential equation

Hi I,m new to matlab and I want solve this differential equation x(3)+ k/c x(2)+ k/m x(1)=0
m=50 c=50 k=1000
Any help would be great. Thanks in advance, leili

回答 (2 件)

Azzi Abdelmalek
Azzi Abdelmalek 2013 年 12 月 7 日

0 投票

Save this function as myfcn.m
function dx=myfcn(t,x)
dx=zeros(3,1)
m=50;
c=50 ;
k=1000;
dx(1)=x(2);
dx(2)=x(3);
dx(3)=(-k/c)*x(3)-(k/m)*x(2);
Call the function myfcn
tspan=[0 10];
x0=[0.1;0.2;0.3] % Initial conditions
[t,x]=ode45(@myfcn,tspan,x0)
plot(t,x)
Venkata Sai Ram Aripirala
Venkata Sai Ram Aripirala 2018 年 11 月 9 日

0 投票

How to write f''' + f'f'' = o in matlab

3 件のコメント

madhan ravi
madhan ravi 2018 年 11 月 9 日
ask a separate question @Venkata
Venkata Sai Ram Aripirala
Venkata Sai Ram Aripirala 2018 年 11 月 9 日
eqn ( f''' + f*f''== 0 ) Is this the foemat to put in Matlab
madhan ravi
madhan ravi 2018 年 11 月 9 日
no, I mean post a separate question because this is not related to the original question

サインインしてコメントする。

カテゴリ

タグ

質問済み:

2013 年 12 月 7 日

コメント済み:

2018 年 11 月 9 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by