Solving conditional nonlinear equations
1 回表示 (過去 30 日間)
古いコメントを表示
I have two equations as below.
equation 1 : a + b = 1;
equation 2 : b = a ( -0.3 < a < 0.3) or a + 0. 2 ( a >= 0.3 or a <= -0.3)
how can i get the answer?
The example is just for the question.
The real problem that I am facing is similar to it.
What I want to know is how to solve a conditional equation with matlab.
Thank you.
0 件のコメント
採用された回答
Ameer Hamza
2020 年 5 月 20 日
See this example
syms a b
eq1 = a + b == 1;
eq2 = b == piecewise(-0.3<a & a<0.3, a, a<=-0.3 | 0.3<=a, a+0.2);
sol = solve([eq1, eq2])
2 件のコメント
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!