Solving conditional nonlinear equations

조회 수: 2 (최근 30일)
byungkeuk cho
byungkeuk cho 2020년 5월 20일
댓글: Ameer Hamza 2020년 5월 20일
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.

채택된 답변

Ameer Hamza
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
byungkeuk cho
byungkeuk cho 2020년 5월 20일
wow. Thank you very much.
piecewise is the one i should know.
Ameer Hamza
Ameer Hamza 2020년 5월 20일
I am glad to be of help!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by