Message Boards Message Boards

0
|
30648 Views
|
13 Replies
|
13 Total Likes
View groups...
Share
Share this post:

Error: Solve was unable to solve the system with inexact coefficients.

Posted 10 years ago

The code is the following

Clear["Global`*"]
kpg = 1
pinf = 20000000
kpm = (.005 - um)
sm = .003 /(.005 - um)
um = .002
kmp = .01
kpn = 1.8
snr = 0.08
knn = .01
knp = .1
unr = .12
un = 0.05
eq2 = snr (knn nstar[t] + knp p[t])/(unr + knn nstar[t] + knp p[t]) - 
   un nstar[t] == 0
b = Solve[eq2, nstar[t]]

It shows an error message saying

Solve was unable to solve the system with inexact coefficients. The answer was obtained by solving a corresponding exact system and numericizing the result. >>

The solution is

{{nstar[t] -> 
   0.2 (-26. - 25. p[t] - 
      1. Sqrt[676. + 1700. p[t] + 625. p[t]^2])}, {nstar[t] -> 
   0.2 (-26. - 25. p[t] + Sqrt[676. + 1700. p[t] + 625. p[t]^2])}}
POSTED BY: steve ma
13 Replies

I suppose ratnz is short for Rationalize, since what Solve is basically doing is wrapping Rationalize around its arguments to make them infinite precision.

POSTED BY: Frank Kampas
POSTED BY: Frank Kampas
Posted 10 years ago

For whatever it's worth I agree with Frank. This issue continually pops up in this and other forums and (incorrectly) suggests to users that something is wrong with Mathematica (which I would think would be important to Wolfram, Inc.).

POSTED BY: Jim Baldwin

Error messages cause users to think the answer is wrong. A warning message would tell the user that the answer is ok but was obtained through a fallback approach. The word "error" has a large impact.

POSTED BY: Frank Kampas

Here is the message in its entirety.

Solve::ratnz: Solve was unable to solve the system with inexact coefficients. The answer was obtained by solving a corresponding exact system and numericizing the result. >>

There is NO mention of any error. Did you not check this before posting?

POSTED BY: Daniel Lichtblau
Posted 10 years ago
POSTED BY: Jim Baldwin
POSTED BY: John Doty
POSTED BY: Daniel Lichtblau

It might be better if it were a warning message rather than an error message.

POSTED BY: Frank Kampas

And what exactly would be the difference between such messages?

POSTED BY: Daniel Lichtblau
Posted 10 years ago

Sorry. I do not understand why it had the error massage. Could you tell me how to get rid of it?

POSTED BY: steve ma

The error message tells all. You used inexact numbers like 1.8 instead of exact numbers like 18/10 as coefficients. Solve is for exact problems. As the message says, it changed your problem to an exact problem, obtained an exact solution, and then "numericized": it changed the exact rational results to floating point numbers.

You need to study Mathematica more before you can use it effectively. Understanding a message like that is elementary.

As for the fix, well, Solve fixed it for you. If you don't want the message, use NSolve.

POSTED BY: John Doty

I don't see a question here.

POSTED BY: Daniel Lichtblau
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract