I am Facing problem using ode45

1 回表示 (過去 30 日間)
Muhammad Usman
Muhammad Usman 2014 年 6 月 27 日
コメント済み: Muhammad Usman 2014 年 6 月 27 日
I wrote this in m-file...
function dx=FtnTest(t,x)
dx=zeros(2,1);
dx(1)=x(2);
dx(2)=-52.1480*(-63.8398)*x(2)-(-4.6941e+06)*x(1);
and use
[t,x]=ode45('FtnTest',[0,100],[0,0])
in command window but it generates only the zero column vectors,please guide me about the error...
Thanks

採用された回答

Roger Stafford
Roger Stafford 2014 年 6 月 27 日
That is no error. A zero vector is the correct solution to the equations and their zero initial values which you have given them. If the original equation had been
dx(2)=-52.1480+(-63.8398)*x(2)-(-4.6941e+06)*x(1);
with addition instead of multiplication in the leftmost operation, then you would obtain a different result. It looks as though that is what you might have meant.
  1 件のコメント
Muhammad Usman
Muhammad Usman 2014 年 6 月 27 日
Thankx

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeOrdinary Differential Equations についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by