Error solving equation in CAS
10-18-2014, 10:46 PM
Post: #1
 toperos Junior Member Posts: 11 Joined: Oct 2014
Error solving equation in CAS
Hello,

I'm trying to find the solutions of the equation:
{(3,068e-3/(0.118+1,001e-5*X))-[[(1+2,126e-5*X)/(1+8,506e-5*X)]-[0.3+2,55e-5*X]]}=0

When i do it in CAS mode with "solve(equation,x)" i get as solutions {-9413.99 ; 15254.47}

And doing the same in non CAS with "FNROOT(equation,X)" i get 12055.26; this is the good solution(I have seen it plotting), but i only get the positive one.

I don't understand what happens or if I am doing something wrong.
10-19-2014, 02:35 AM
Post: #2
 Helge Gabert Senior Member Posts: 467 Joined: Dec 2013
RE: Error solving equation in CAS

You shouldn't need any "{}" nor "[]". Are the "," thousand separators, or are they decimal points "."? All "X" should be "x" in CAS.

In CAS, try fsolve(your equation, x). You can also use a starting value, or interval (see help for fsolve).

In Home, try FNROOT with a starting guess close to the second solution (again, see help for FNROOT). Here "X" is OK.
10-19-2014, 08:13 AM
Post: #3
 toperos Junior Member Posts: 11 Joined: Oct 2014
RE: Error solving equation in CAS
((3.068E-3/(0.118+1.001E-5*X))-(((1+2.126E-5*X)/(1+8.506E-5*X))-(0.3+2.55E-5*X)))=0
The "." are decimal points.

In CAS (with X as x) with "solve" or "fsolve" i get {-9413.99 ; 15254.47} ; but if I use a starting value (solve(equation,x,1)) I get the right solution 12055.26

So should I always put a starting value, or interval?
10-19-2014, 12:08 PM
Post: #4
 parisse Senior Member Posts: 1,178 Joined: Dec 2013
RE: Error solving equation in CAS
Yes, that way you are certain that an iterative method is used. Otherwise solve/fsolve will check for a polynomial equation and apply methods that can be suited to exact coefficients but not to approx ones, that's the case here, and bad thing can happen (here because the leading coefficient of the numerator is very small).
10-19-2014, 12:47 PM
Post: #5
 DrD Senior Member Posts: 1,132 Joined: Feb 2014
RE: Error solving equation in CAS
Perhaps a hint here is that after copy/pasting this expression from your text into EMU/CAS (Var X:=0 in this example):

((3.068E-3/(0.118+1.001E-5*X))-(((1+2.126E-5*X)/(1+8.506E-5*X))-(0.3+2.55E-5*X)))=0

The EMU/CAS Entry line resulted in this:

$$\left(\frac{3.068e-3}{0.118+1.001e-5*X} {-} \left(\frac{1+2.126e-5*X}{1+8.506e-5*X} {-} \left({0.3+2.55e-5*X}\right) \right)\right) {=0}$$

EMU/CAS then produced this output:

$$\left({-.674}\right){=0}$$

Exactly approximate and vice versa!
 « Next Oldest | Next Newest »

User(s) browsing this thread: 1 Guest(s)