Greetings,
I am new to Mathematica and I am wondering why the command:
Solve[ { y*x == 15, x==5}, y]
Yields:
{}
Thanks,
Jay
Greetings,
I am new to Mathematica and I am wondering why the command:
Solve[ { y*x == 15, x==5}, y]
Yields:
{}
Thanks,
Jay
Perhaps think: 2 equations, 2 unknowns. Try
Solve[ { y*x == 15, x==5},{x, y}]
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.
There is no value of y that makes the predicate x == 5 evaluate to True.
Another way to write the equation:
Solve[y*x == 15 /. x -> 5, y]
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?
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.
Thanks Michael for responding to my earlier inquiry. Will try to check the function again and recompile.