Parametric Solving Equations with Constraints

8 ビュー (過去 30 日間)
EllaD
EllaD 2020 年 10 月 30 日
コメント済み: EllaD 2020 年 10 月 30 日
Hello,
I'm using syms mode and I have two equations in x and y:
syms a b x y d e
eq1= (a^2+b)*x+b*y+d*e
eq2=(-d)*x+(e^2+a^2+b)*y+a
Now I can apply :
solve( eq1, eq2, x,y)
and I get a parametric solution.
Is there a way to parametrically solve with constraints, say (x>0 and y>b)?
Thanks!

回答 (1 件)

Ameer Hamza
Ameer Hamza 2020 年 10 月 30 日
You can use assume() to tell MATLAB about these constraints. For example
syms a b x y d e
assume(x>0)
assume(y>b)
eq1= (a^2+b)*x+b*y+d*e;
eq2=(-d)*x+(e^2+a^2+b)*y+a;
sol = solve([eq1, eq2], [x,y], 'ReturnConditions', true)
  1 件のコメント
EllaD
EllaD 2020 年 10 月 30 日
Thank you Ameer!

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

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by