isAlways: what did I do wrong?
2 次查看(过去 30 天)
显示 更早的评论
Hi,
I have a somewhat complicate function of only 1 variable. When I plot it from the range [1, 10], it's clear that the function is always negative. However, when I use isAlways (with appropriate assumptions on the domain of the function), it gives me an unknown (unable to prove). Please find the sample code below. Seems like you'd need R2012 for assumeAlso to work.
Thanks a lot!
clear;
syms x real
W2 = 2*((25*(3*x - 30))/(11*(25*x - 8)^2) - 3/(11*(25*x - 8)) + 75/(25*x - 8)^2)*((3*x - 30)/(11*(25*x - 8)) + 3/(25*x - 8) - 1/11) - 2*((25*(3*x - 27))/(11*(25*x + 17)^2) - 3/(11*(25*x + 17)))*((3*x - 27)/(11*(25*x + 17)) - 1/11);
assumeAlso(x >= 1);
assumeAlso(x < 10);
fW2 = inline(char(W2));
fplot(fW2, [1, 10]);
isAlways(W2 < 0, 'Unknown', 'error');
回答(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!