Problem with solve

Problem with solve - 消息

#1 已发布: 2011/6/18 09:01:27
Abhi

Abhi

0个赞,共4个帖子。

组: User

Hi,

I've found what looks like a bug in solve(). Could anyone please help?

Thanks in advance,

Abhi

#2 已发布: 2011/6/18 10:40:07
Radovan Omorjan

Radovan Omorjan

325个赞和1个踩,共2,052个帖子。

组: Moderator

Hello,

There is already mentioned few times about solving equations with solve() and roots().
The solve() function has a searching algorithm trying to find all the real roots in the given range, and it can fail like most of the numerical procedures. It is advisable to use 4 arguments solve(). The default range is set by default to [-20,20] - Tools|Options|Calculation|Roots range - where it is not suitable in some cases (like in yours)

In your case:
[MATH=eng]a←1[/MATH][MATH=eng]b←263.84[/MATH][MATH=eng]c←-61463[/MATH]
[MATH=eng]f(x)←a*x^2+b*x+c[/MATH]
[MATH=eng]solve(f(x),x,-450,150)=#@#[/MATH]
solve() will probabely fail. Therefore, you can try to find the roots one by one:
[MATH=eng]solve(f(x),x,-500,-300)=-412.7507[/MATH]
[MATH=eng]solve(f(x),x,100,200)=148.9107[/MATH]
or using roots()
[MATH=eng]roots(f(_x),_x,-400)=-412.7507[/MATH]
[MATH=eng]roots(f(_x),_x,150)=148.9107[/MATH]

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#3 已发布: 2011/6/19 10:02:07
Abhi

Abhi

0个赞,共4个帖子。

组: User

OK, got it.

Thanks
  • 有新帖
  • 无新帖