Solving non linear inequalities in 2 variables
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposta accettata
John D'Errico
il 5 Feb 2024
Modificato: John D'Errico
il 5 Feb 2024
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)
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 Commenti
John D'Errico
il 5 Feb 2024
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.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Stability Analysis in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!