Solving non linear inequalities in 2 variables

I have the following inequalities that I need to solve and find the range of the variables (a and T) to solve my control problem -
24 - 8*a - 2*a^2 + (2*a^2)/T + (2*a^2)/T^2 + (20*a)/T < 0
- 8*a - (8*a)/T + 32/T - 2*a^3 - (16*a^2)/T - (2*a^3)/T - (4*a^2)/T^2 - (2*a^3)/T^2 - 32 < 0
4*a- (8)/T < 0
How should I do this in matlab ?

댓글 수: 2

Are you from IIT delhi?
a=-2 and T=0.5 should be a solution

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

 채택된 답변

John D'Errico
John D'Errico 2024년 2월 5일
편집: John D'Errico 2024년 2월 5일
The "range of variables? Those inequalities will generally describe some nonlinear "thing", even if they describe a bounded domain. In fact, it is entirely possible the bounds are not even finite, since we see 1/T all over the place. It is also very possible that no solution exists at all.
As well, you use a strict inequality. But no tool working in floating point arithmetic can specify a strict inequality like that.
So there is likely no simple range you can derive from those inequalities. At best, we can use the final inequality to learn that a must be less than 2/T, But that is useless, since T can be infinitely large. And if T is near zero, then a can be infinitely large. And if T is negative, then a can go out to minus infinity. Can we do anything?
Well, we can turn the inequalities into strict equalities, and plot them. But we won't really know which side of those curves is good.
syms a T
fimplicit(4*a - 8/T == 0,'r')
hold on
fimplicit(24 - 8*a - 2*a^2 + (2*a^2)/T + (2*a^2)/T^2 + (20*a)/T == 0,'g')
fimplicit(-8*a - (8*a)/T + 32/T - 2*a^3 - (16*a^2)/T - (2*a^3)/T - (4*a^2)/T^2 - (2*a^3)/T^2 - 32 == 0,'b')
hold off
You should see that no matter what, the result will be a mess. Another idea is to turn the problem into a discrete one, so not truly exact, but it will give you an idea. I'll go out pretty far in both a and T. And I'll use a very fine grid. Finally, note my careful use of the dotted operators below, to insure the correct computations will be done.
[a,T] = meshgrid(linspace(-50,50,5000));
good = (24 - 8*a - 2*a.^2 + (2*a.^2)./T + (2*a.^2)./T.^2 + (20*a)./T < 0) &...
(-8*a - (8*a)./T + 32./T - 2*a.^3 - (16*a.^2)./T - (2*a.^3)./T - (4*a.^2)./T.^2 - (2*a.^3)./T.^2 - 32 < 0) & ...
(4*a- (8)./T < 0);
plot(a(good),T(good),'.')
Do you see that no plot was produced? Why not? How many points were identified in that domain, that satisfy all three of those inequalities?
find(good)
ans = 0×1 empty double column vector
That suggests the locus that satisfies all three of those inequalities may be the null sel. Now, maybe I did not go out far enough in either a or T. But it seems like all of the action was happening not too far away from zero. So if any solution does exist, it should have been seen. I will postulate the solution is actually rather easy. The viable range of those variables is probably the null set.

댓글 수: 3

Manas
Manas 2024년 2월 5일
Okk thanks for the help !! Maybe there's some error from my side cause a solution should exist....I'll recheck it.
Yes. My guess is you have some error in the equations, as they seem inconsistent. The trick I used with meshgrid should produce a result though, if a solution does exist. You may need to push it out further of course, as I don't know what is even reasonable there. For example, must they both always be positive? Since I have no idea what the variables represent, I cannot know.
Manas
Manas 2024년 2월 6일
No worries, I have resolved the problem. Thanks for your help.

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

추가 답변 (0개)

카테고리

질문:

2024년 2월 5일

댓글:

2025년 2월 15일

Community Treasure Hunt

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

Start Hunting!

Translated by