Can I check if an inequality is true, and if not, get the conditions where the inequality could be true?
    조회 수: 5 (최근 30일)
  
       이전 댓글 표시
    
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
답변 (1개)
  Vidhathri LNU
    
 2020년 6월 30일
        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
참고 항목
카테고리
				Help Center 및 File Exchange에서 Assumptions에 대해 자세히 알아보기
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

