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 Center および File ExchangeAssumptions についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by