フィルターのクリア

Trying to solve linear system of equations into matrix form error

1 回表示 (過去 30 日間)
Jack
Jack 2020 年 12 月 18 日
コメント済み: Jack 2020 年 12 月 18 日
Here is my line of code and looking to put into matrix form Ax=B.
I keep getting the error "Unable to convert to matrix form because the system does not seem to be linear"
Any ideas on how to fix this? I am new to matlab and do not know if it is just syntax.
syms m1 ac1 g rot1x R2 f2 f1 m2 ac2 rot2x R3 f3 f2 a1 l1 w_dot1 l1 w1 a2 l2 w_dot2 w2 a0 l0 w_dot0 w0
eqn1 = (m1 * ac1) - (m1 * g * rot1x) - (R2*f2) == f1;
eqn2 = (m2 * ac2) - (m2 * g * rot2x) + (R3 * f3) == f2;
eqn3 = a1 + (0.5 * l1 * w_dot1) + (0.5 * l1 * w1) == ac1;
eqn4 = a2 + (0.5 * l2 * w_dot2 + 0.5 * l2 * w2) == ac2;
eqn5 = R2 * (a0 + l0 * w_dot0) + (l0 * w0) - a1 == 0;
eqn6 = R3 * (a1 + l1 * w_dot1) + (l1 * w1) - a2 ==0;
[A,B] = equationsToMatrix([eqn1, eqn2, eqn3, eqn4, eqn5, eqn6]);

採用された回答

Marco Riani
Marco Riani 2020 年 12 月 18 日
% eqns must be linear in vars.
% Specify vars as follows (for example).
vars=[m1, m2, w1, w2, w_dot0, w_dot1];
[A,B] = equationsToMatrix([eqn1, eqn2, eqn3, eqn4, eqn5, eqn6],vars);
% Of course I do not what are your vars so I tried to guess
  5 件のコメント
Marco Riani
Marco Riani 2020 年 12 月 18 日
2020b on windows
Jack
Jack 2020 年 12 月 18 日
thanks for all the help!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by