0
$\begingroup$

I'm stuck with what seems to be an extremely simple issue, still, I just can't seem to find the solution or even the cause of the problem.

So my issue is that I have the following surfaces:

f[x_,y_]:=-1 + 1/(1.8 (0.02 + x) + 1.2 (0.02 + y));
g[x_,y_]:=-1 + 1/(0.15 + x + 1.2 (0.15 + y));

which intersect for sure, I checked via Plot3D, but

Solve[f[x,y]==g[x,y],y] 

returns {}. This baffles me, what is happening?

Tried with exact coefficients, tried restarting the kernel, no change.

$\endgroup$
4
  • 1
    $\begingroup$ Have you tried replacing the inexact numbers with exact ones (e.g. replace 1.8 with 9/5)? $\endgroup$ Jul 24, 2015 at 10:39
  • $\begingroup$ When I try to solve it generally, Mathematica produces the warning "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." so that doesn't seem to be a problem (or am I missing something? :/ ) $\endgroup$ Jul 24, 2015 at 10:40
  • $\begingroup$ But just to make sure, I tried it with exact coeffs now, to no avail. $\endgroup$ Jul 24, 2015 at 10:45
  • $\begingroup$ Most likely you want to find the simpltaneous zero set, that is, Solve[{f[x,y]==0,g[x,y]==0},{x,y}]. $\endgroup$ Jul 24, 2015 at 13:37

1 Answer 1

2
$\begingroup$

The issue is that you're asking for a general solution for y only whereas your particular set of equations has a solution only for one specific value of x.

You should have called Solve as:

Solve[f[x, y] == g[x, y], {x, y}]
During evaluation of 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. >>

During evaluation of Solve::svars: Equations may not give solutions for all "solve" variables. >>
(* {{x -> 0.3375}} *)

or better, with exact coefficients:

f[x_, y_] := -1 + 1/(18/10 (2/100 + x) + 12/10 (2/100 + y));
g[x_, y_] := -1 + 1/(15/100 + x + 12/10 (15/100 + y));


Solve[f[x, y] == g[x, y], {x, y}]
During evaluation of Solve::svars: Equations may not give solutions for all "solve" variables. >>
(* {{x -> 27/80}} *)

In this case Reduce or SolveAways would have been better approaches:

Reduce[f[x, y] == g[x, y], y]
(* x == 27/80 && 89 + 160 y != 0 *)

SolveAlways[f[x, y] == g[x, y], y]
(* {{x -> 27/80}} *)
$\endgroup$
3
  • $\begingroup$ But shouldn't this solution also contain a value for y? I'm confused. $\endgroup$ Jul 24, 2015 at 10:56
  • 1
    $\begingroup$ No, for the given value of x all y's are a solution. Check f[27/80, y] - g[27/80, y] // FullSimplify for the system with exact coefficients. $\endgroup$ Jul 24, 2015 at 10:58
  • $\begingroup$ Ohh, thanks a lot! $\endgroup$ Jul 24, 2015 at 11:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.