Problem Solving Symbolic Inequalities
显示 更早的评论
I'm trying to use Matlab to solve inequalities like the example below, but only have partial sucess, with other times getting the result shown below.
EDU>> solution=solve('((k1^2 + 1080.0*k1 - 2948400.0)/(k1 - 4660.0))>0')
solution = matrix([[solve([0.0 < (k1^2 + 1080.0*k1 - 2948400.0)/(k1 - 4660.0)], [k1])]])
I know that the solutions for this example are -2340<k1<1260 & k1>4660, is there something that I can do differently to make this work in Matlab? Thanks.
采纳的回答
更多回答(1 个)
Walter Roberson
2012-3-14
Symbolic solvers are notoriously poor at inequalities. All except the long-gone Axiom: it was supposedly good.
In the particular case above, Maple 15 gives the solution as
RealRange(Open(-2340), Open(1260))
RealRange(Open(4660), infinity)
In general, though, what I usually end up doing is transforming the inequality in to an equality by introducing a variable that I add constraints on to:
syms k1
syms c positive
solve( ((k1^2 + 1080.0*k1 - 2948400.0)/(k1 - 4660.0)) - c, k1)
Since the assumed-positive value c needs to be subtracted for the expression to equal 0, then that is equivalent to saying that the result of the expression (without the "- c") must be positive.
There have been a fair number of expressions in Maple that I could not get anywhere on until I substituted a particular number (symbolic) as the difference and made the expressions in to equalities.
类别
在 帮助中心 和 File Exchange 中查找有关 Equation Solving 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!