Group Abstract Group Abstract

Message Boards Message Boards

0
|
1.1K Views
|
7 Replies
|
7 Total Likes
View groups...
Share
Share this post:

Solve function yields empty set answer

Posted 19 days ago

Greetings, I am new to Mathematica and I am wondering why the command:

Solve[ { y*x == 15, x==5}, y]

Yields:

{}

Thanks,
Jay

POSTED BY: Jay Schultz
7 Replies

Dear All, I have probably a similar problem regarding the use of the function Solve. Does it have any limit of how big the equations are? For instance, I'm trying to evaluate the steady-state solution for these system; https://www.wolframcloud.com/obj/chhekarl/Steady_state_reactor.nb

and it gave me

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

Could anyone verify this?

POSTED BY: Hekarl Uzir

One gets this message when one has decimal points in the numbers in the equations. Inexact floating-point arithmetic is normally used to compute with these numbers. Solve[] converts the numbers to rational numbers represented exactly by a ratio of integers. It then solves the exact system and converts the solution back to floating-point numbers. Solve[] generally expects exact input, although it usually deals effectively with inexact input. But because of this expectation and because it rounded the numbers to rational and then rounded the solutions back to floating-point, it issues a warning message. If the answer seems wrong, the user knows a possible, albeit unlikely, reason for the discrepancy is the numerical conversions. If the answer seems right, you can ignore the message, and this is the more common case in my experience.

POSTED BY: Michael Rogers

Thanks Michael for responding to my earlier inquiry. Will try to check the function again and recompile.

POSTED BY: Hekarl Uzir
Posted 19 days ago

Another way to write the equation:

Solve[y*x == 15 /. x -> 5, y]
POSTED BY: Hans Milton

There is no value of y that makes the predicate x == 5 evaluate to True.

POSTED BY: Gianluca Gorni

Bill Nelson has the right idea. The behavior of Solve[] is a bit hard to understand. I often forget how Solve[] works in such a case. Only when it gives me the unexpected answer do I recall the following from its documentation:

Solve gives generic solutions only.

Technically, your system {y*x == 15, x==5} consists of two conditions. The solution {y -> 3} is valid provided x == 5. That is a specific, and not a generic, condition. The option MaxExtraConditions allow you to change this default behavior. You can set it to MaxExtraConditions -> Automatic or MaxExtraConditions -> 1 or the following:

Solve[{y*x == 15, x == 5}, y, MaxExtraConditions -> All]
(*  {{y -> ConditionalExpression[3, x == 5]}}  *)

An undocumented workaround is to use {x}, with the braces, as the 3rd argument, which asks Solve[] to eliminate x from the solutions:

Solve[{y*x == 15, x == 5}, y, {x}]
(*  {{y -> 3}}  *)

Or you can solve it Bill's way.

POSTED BY: Michael Rogers
Posted 19 days ago

Perhaps think: 2 equations, 2 unknowns. Try

Solve[ { y*x == 15, x==5},{x, y}]
POSTED BY: Bill Nelson
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard