How to check the positivity function?

조회 수: 2 (최근 30일)
Andrea Strappato
Andrea Strappato 2021년 10월 2일
답변: Walter Roberson 2021년 10월 2일
I can't prove the positivity of the function:
y = x1 - x2 + sin(x1)
such that:
0<x1<0.0001
0<x2<0.0001
x1>x2
My matlab code is:
x = sym('x', [1 2], 'real')
assume(0.0001>x>0 & x(1)>x(2))
y = x(1) - x(2) + sin(x(1))
isAlways(y>=0)
%Below the responde from command window
Warning: Unable to prove '0 <= x1 - x2 + sin(x1)'.
> In symengine
In sym/isAlways (line 42)
Why Matlab can't prove the positivity of the function y?
I can prove that "x(1)-x(2)" and "sin(x(1))" are positive, I don't know why I can't prove the positivity of the sum of positivity term.
Any kind of help is appreciate, I'm stucked on this for hours..

채택된 답변

Walter Roberson
Walter Roberson 2021년 10월 2일
Eh. So split it up. x1 strictly > x2 impliex x1 - x2 > 0
x1 > 0 and x1 < pi implies sin(x1) > 0
the sum of two positive quantities is positive.
x = sym('x', [1 2], 'real')
x = 
assume(0.0001>x>0 & x(1)>x(2))
y1 = x(1) + x(2)
y1 = 
y2 = sin(x(1))
y2 = 
isAlways(y1 > 0)
ans = logical
1
isAlways(y2 > 0)
ans = logical
1
syms y3 y4 %y3 is the positive quantity y1, y4 is the positive quantity sin(x(1))
assume(y3>0 & y4>0)
isAlways(y3+y4 > 0)
ans = logical
1

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by