solve set of inequalities and plot the solution

조회 수: 2 (최근 30일)
Gaetano Pavone
Gaetano Pavone 2025년 5월 15일
댓글: Gaetano Pavone 2025년 5월 16일
I want to solve the following inequalities and then plot the solution:
syms alpha beta
eq_E_Bar=0.0664057051742095*alpha+beta*(-0.0900076050430003)<=0;
eq_I_Bar=-0.147476397055133*alpha+beta*(-0.160063987615969)<=0;
eq_I_CD=-0.122381054306963*alpha+beta*(0.125233998946155)>=0;
eq_CH=0.0733606912576878*alpha+beta*(0.0218230571691888)>=0;
eq_E_CD=-0.00347678534715134*alpha+beta*(0.0182604037132820)>=0;
eq_CI=-0.0559753491327545*alpha+beta*(0.0352263939031544)>=0;
feasible_sol=solve([eq_E_Bar,eq_I_Bar,eq_I_CD,eq_CH,eq_E_CD,eq_CI],[alpha beta],ReturnConditions=true)
feasible_sol = struct with fields:
alpha: (2256015163952083*x1)/2204621082296188 + x beta: x1 parameters: [x x1] conditions: 10549189801660689702269137781572*x <= 3503468021860192787493706908071*x1 & 0 <= 5827028370741121936647379822184*x + 7696269995943263088326695380347*x1 & 177844533…
cond=feasible_sol.conditions
cond = 
Is my code correct?

채택된 답변

Torsten
Torsten 2025년 5월 15일
편집: Torsten 2025년 5월 15일
A = [-0.0664057051742095,0.0900076050430003;...
0.147476397055133,0.160063987615969;...
-0.122381054306963,0.125233998946155;...
0.0733606912576878,0.0218230571691888;...
-0.00347678534715134,0.0182604037132820;...
-0.0559753491327545,0.0352263939031544];
b = [0;0;0;0;0;0];
lb = [-100;-100];
ub = [100; 100];
plotregion(A,b,lb,ub);
Download "plotregion" from
It's not clear what you mean by "solve the inequalities". The plot suggests that two of the inequalities are the relevant ones. So the "solution" is given by the intersection of the regions defined by two out of the six inequalities you posted.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Numeric Solvers에 대해 자세히 알아보기

태그

제품


릴리스

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by