Can I check if an inequality is true, and if not, get the conditions where the inequality could be true?
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello,
I am pretty new to Matlab. I have to check if an expression is positive, given some conditions. This is my code right now:
%general conditions
assume(0<beta & beta<alpha & alpha<1)
assumeAlso(b > 0 & p > 0 & c > 0 & f1 > 0 & f2 > 0 & f3 > 0 & f4 > 0)
%additional conditions
assumeAlso(f1 > f3)
assumeAlso(f1 > f3)
assumeAlso(alpha > 1/2)
assumeAlso(beta*f2 < f3)
assumeAlso(f4 < beta*(f1-f3))
isAlways((alpha*b*f3 + 2*b*beta*f1 - 2*b*beta*f3 - alpha*b*beta*f1 + alpha*b*beta*f3)/(alpha*f3 + beta*f1 - beta*f3) - (((b - 2*alpha*b)/alpha - alpha*(b/alpha + (f3 - beta*f2)/(alpha*beta)))/(alpha*f3 + beta*f1 - beta*f3) + (f4 - beta*f1 + beta*f3)/(alpha*f3 + beta*f1 - beta*f3))*(alpha*f3 + beta*f1 - beta*f3) > 0)
This is giving me a warning:
Warning: Unable to prove '0 < (alpha*b*f3 + 2*b*beta*f1 - 2*b*beta*f3 - alpha*b*beta*f1 +
alpha*b*beta*f3)/(alpha*f3 + beta*f1 - beta*f3) - (((b - 2*alpha*b)/alpha - alpha*(b/alpha + (f3 -
beta*f2)/(alpha*beta)))/(alpha*f3 + beta*f1 - beta*f3) + (f4 - beta*f1 + beta*f3)/(alpha*f3 + beta*f1 -
beta*f3))*(alpha*f3 + beta*f1 - beta*f3)'
Which I understand because there might be additional conditions which are needed for my expression to be positive.
Is there another method I can use instead of isAlways that can return me the conditions where this statement is true?
0 Kommentare
Antworten (1)
Vidhathri LNU
am 30 Jun. 2020
You can use the 'solve' function by setting the parameter 'ReurnConditions' to 'true' to get the conditions on the solution.
Please refer to the Solve inequalities section of the documentation for further understanding.
Hope this answers your query.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Assumptions finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!