Group Abstract Group Abstract

Message Boards Message Boards

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

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

Posted 11 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

It's true that the workd "Error" does not appear. Guess I didn't drink enough coffee this morning. However, I think Jim's suggestion for the message is a good one.

POSTED BY: Frank Kampas
Posted 11 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 11 years ago

It is true that the word "Error" does not appear. But when a new user sees something unintelligible like "Solve::ratnz" and the word "unable", it strongly suggests that something is wrong. Maybe the message should start with "The answer was obtained..." and end with "because Solve was unable to solve...." (And while I've used Mathematica at a very low level for over twenty years, I still haven't a clue as to what value the term "ratnz" is to me.)

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 11 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