Solving a complicated non-linear equation in Simulink

6 ビュー (過去 30 日間)
Sharanya
Sharanya 2023 年 6 月 28 日
コメント済み: Sharanya 2023 年 6 月 28 日
Is it in any way possible to solve in equation in a MATLAB function block in Simulink? The only variable is the one marked in red, all other are constants.

採用された回答

Torsten
Torsten 2023 年 6 月 28 日
移動済み: Torsten 2023 年 6 月 28 日
With suitable constants c1,...,c6 and substituting x = sin(sigma_A^EC), your equation can be written as
c1*(x^2-c2) - c3*(x*c4-sqrt(1-x^2)*c5) - c6 = 0
Isolating sqrt(1-x^2) on one side of the equation and squaring gives a polynomial of degree 4 in x. The roots of this polynomial can either be solved for analytically using the "solve" command or numerically using the "root" command.
syms c1 c2 c3 c4 c5 c6 x
eqn = c1*(x^2-c2) - c3*(x*c4-sqrt(1-x^2)*c5) - c6 == 0
eqn = 
solve(eqn,x,'MaxDegree',4)
Warning: Possibly spurious solutions.
ans = 
  1 件のコメント
Sharanya
Sharanya 2023 年 6 月 28 日
Thanks a lot! I will try this.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSystems of Nonlinear Equations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by