I tried to convert odes to ss but i have problem//o​deToVector​Field

1 回表示 (過去 30 日間)
meng fowler
meng fowler 2021 年 1 月 12 日
コメント済み: meng fowler 2021 年 1 月 13 日
syms x(t) f(t) x3(t) g(t) t
eqn1 = v == diff(x, t);
eqn2 = diff(v) == -3647.333890*x-99.48571587*v+3947.845868*x3+3947.845868*g+0.0002385211688*f;
eqn3 = diff(x3) == -0.004499581734*eqn2-0.71466948*v-28.3599*x+28.3599*g;
eqns = [eqn1 eqn2 eqn3];
V = odeToVectorField(eqns)
I want to solve this but it shows me error
i have 3 odes f and g are inputs x,v are outputs and x3 is state variable ?
  2 件のコメント
Star Strider
Star Strider 2021 年 1 月 12 日
You will probably end up using equationsToMatrix, however you will have to edit your system first to make it compatible (and linear).
meng fowler
meng fowler 2021 年 1 月 12 日
Can you send me the matlab code for this equations please?

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

採用された回答

Walter Roberson
Walter Roberson 2021 年 1 月 12 日
Your code had some problems.
You were not declaring v as a function.
Your definition of eqn3 involved multiplying eqn2 by a value, but eqn2 is an equality and multiplying it by a value as part of an expression is dubious.
I had to guess what you might possibly mean by multiplying by eqn2 there. I probably guessed wrong, so review your system.
syms x(t) f(t) x3(t) g(t) v(t)
eqn1 = v == diff(x, t);
eqn2 = diff(v) == -3647.333890*x-99.48571587*v+3947.845868*x3+3947.845868*g+0.0002385211688*f;
eqn3 = diff(x3) == -0.004499581734*rhs(eqn2)-0.71466948*v-28.3599*x+28.3599*g;
eqns = [eqn1; eqn2; eqn3]
eqns(t) = 
vars = [f(t), g(t), v(t), x(t), x3(t)]
vars = 
[V, S] = odeToVectorField(eqns)
V = 
S = 

その他の回答 (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