0
|
30557 Views
|
13 Replies
|
13 Total Likes
View groups...
Share
GROUPS:

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])}} 
13 Replies
Sort By:
Posted 10 years ago
 I don't see a question here.
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 10 years ago
 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 10 years ago
 It might be better if it were a warning message rather than an error message.
Posted 10 years ago
 And what exactly would be the difference between such messages?
Posted 10 years ago
 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 10 years ago
 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 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 10 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 10 years ago
 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 10 years ago
 I still haven't a clue as to what value the term "ratnz" is to me. "ratnz" is the message tag you'd use if you wanted to do something like Catch or Off to manage the situation. Type "ratnz" into the search box in the help window, and have a look a Reduce::ratnz to find out what it means.
Posted 10 years ago
 But when a new user sees something unintelligible like "Solve::ratnz" and the word "unable", it strongly suggests that something is wrong. I have to say I think this is a stretch. True, "Solve::ratnz" is meaningless. That part of every error message is going to be fairly meaningless. As John Doty noted, it is a tag and has use e.g. in Check or Quiet` or other functions he noted. The fact that it shows up first in the message is a design decision that predates my time here. As for "unable", one simply has to read the message. Failure to do so is not a fault in the message. Having grown up in the days of the IBM Fortran error messages, I'm quite comfortable stating that this particular message is quite fine as is. It spells out the situation accurately.The small issue of this particular message is not whether it should be reworded (I doubt any one here will take the time to do that) but rather whether it should simply be removed. Offhand I do not see a down side to removal. (Rewording, in contrast, carries the risk that another group will come along and dislike specifics of that wording, leading to a rinse-and-repeat cycle.)There is a much larger issue which is getting some discussion in house. It is whether or how to separate messages into pools or levels (presumably in a way that would be user configurable but have default settings). So perhaps there could be warnings, fatal errors, possibly incorrect result errors, etc. Any undertaking in this direction would be a major one and so I'm not sure we'll want to pursue it. But there are of course benefits to separating levels and/or classes of "error".
Posted 10 years ago
 I suppose ratnz is short for Rationalize, since what Solve is basically doing is wrapping Rationalize around its arguments to make them infinite precision.