필터 지우기
필터 지우기

Parametric solutions to system of equations inequations via solve()

조회 수: 3 (최근 30일)
Arthur
Arthur 2014년 11월 8일
댓글: Arthur 2014년 11월 13일
Given a square matrix A in n x n symbolic variables a_{i,j}, I want a parametric solutions for the a_{i,j} constrained to a system of equations and inequalities.
For instance, given
syms a, b, c, d, x
A = [[a, b]; [c, d]]
e(x) = charpoly(A, x)
I would like to find parametric solutions for all a, b, c, d that satisfy, for example
e(1)==0 and a >= 0, b >= 0, c >= 0, d >= 0.
Maple has functionality like this ("Solve semi-algebraic", or something) and I would like to be able to do this with Matlab.
I attempted to use solve() (see attached screenshot), but, even in this simpler case I consider there, I get the warning and the empty solution, so I'm guessing that I'm not understanding the solve() function correctly.
Thank you.

채택된 답변

Stefan Wehmeier
Stefan Wehmeier 2014년 11월 11일
I see that you are using R2014a. Then your only option is to solve for one variable
solve(e(1) == 0, a)
and take this as a parameterization with which you can play by plugging in values for two variables, and solving result>=0 for the third.
If you upgrade to R2014b, just
solve([e(1) == 0, a>=0, b>=0, c>=0, d>=0], [a, b, c, d])
works and gives you some solutions.
  댓글 수: 1
Arthur
Arthur 2014년 11월 13일
Alas, there is no student edition of R2014b. Strange that this feature would be unavailable until that release.
Anyway, thanks for your answer.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Equation Solving에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by