isAlways: what did I do wrong?

2 次查看(过去 30 天)
Art
Art 2012-11-6
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');
  1 个评论
Art
Art 2012-11-6
Nevermind... got it, I think. After I did
W2 = simple(W2);
And do the same thing, it gives me the answer.
Thanks!

请先登录,再进行评论。

回答(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