Solve() gives wrong answer (r10077)
|
04-27-2016, 01:16 PM
Post: #2
|
|||
|
|||
RE: Solve() gives wrong answer (r10077)
(04-27-2016 09:47 AM)drkosse Wrote: Hi, It's a rounding problem. The exact equation has two equal real roots which the CAS finds perfectly well with 4/100 and 24/10 in place of 0.04 and 2.4. With the approximate numbers in place I'm assuming that b^2-4*a*c is - just! - negative and so no real root exists. Keeping the approximate numbers and changing 36 to 35.99999999 also works, as does using csolve instead of solve. What is more annoying is that taking the equation 0.04*x^2-2.4*x+30=0 (which has two real roots that solve finds without difficulty) and multiplying each term by 1e-16 produces an equation that solve (or fsolve or csolve) won't solve. The CAS has a particular aversion to small approximate numbers which other systems do not share. As a physicist I find this frustrating, although once aware of the problem there are work-arounds. Nigel (UK) |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 4 Guest(s)