So I have a function f1[x,y]
that includes a parameter c
. I would like to solve the corresponding f1[x,y]==0
for positive x and y (depending on c
), with the further restriction that c>=0
, but I do not know how to encode all of this properly.
My try was:
Reduce[f[x,y]==0 && x>0 && y>0 &&c>=0, {x,y}]
But it does not seem to work (it is stuck "running"), while playing around a little bit NSolve[f[x,y]==0, {x,y}]/. -> c=1
, or any positive c
have many solutions, among which some for positive x
and y
. Conversely, also NSolve[f[x,y]==0 &&x>0 && y>0, {x,y}]/. -> c=1
is stuck running. Am I doing something wrong?
To completely reproduce the framework I am using I would have to add many useless stuff, so I've worked out a minimal reproduction of the problem I have using two functions:
f1[x_, y_] := (50 (2 p^6 (20 + y) - p^2 (-2 + x) x^3 (20 + 3 y) +
p^4 x (3 x (-20 + y) + 2 (60 + y))))/((p^2 + x^2)^3 (20 + y))
f2[x_, y_] := (p^4 (20 + y)^2 + x^4 (20 + y)^2 +
2 p^2 x^2 (1400 - 1000 x + 40 y + y^2))/((p^2 + x^2)^2 (20 + y)^2)
NSolve[f1[x, y] == 0 && f2[x, y] == 0, {x, y}] /. p -> 4
Where the NSolve gives as output:
{{x -> 1.01264, y -> -18.804}, {x -> 5.21585,
y -> 24.3412}, {x -> 6.26257, y -> -66.5406}, {x -> 179.176,
y -> -7.27542}, {x -> -4.13331 - 0.549203 I,
y -> -22.4456 + 51.1497 I}, {x -> -4.13331 + 0.549203 I,
y -> -22.4456 - 51.1497 I}, {x -> -0.112599 - 2.93525 I,
y -> 91.3789 + 57.5289 I}, {x -> -0.112599 + 2.93525 I,
y -> 91.3789 - 57.5289 I}, {x -> 0.412582 - 2.45391 I,
y -> -55.0916 - 58.626 I}, {x -> 0.412582 + 2.45391 I,
y -> -55.0916 + 58.626 I}}
Where the second one is clearly positive. However, NSolve[f1[x, y] == 0 && f2[x, y] == 0 && x > 0 && y > 0, {x, y}] /. p -> 4
does not find it and remains stuck. At the same time, Reduce
finds roots in the unbounded case and not in the bounded one.
Reduce
you should be able to find them. However without definition off
there is nothing to say. Iff
is too complicated try to provide another example that one might go ahead with. $\endgroup$ – Artes Aug 14 '20 at 9:50NSolve[f[x,y]==0, {x,y}]\.c->1
provides me with many solutions with some positive andNSolve[f[x,y]==0 &&x>0 && y>0, {x,y}]\.c->1
is stuck running? I mean there is no reason for the solutions of the second not to be a subset of the first, if I am not making errors with the coding $\endgroup$ – Thanatopseustes Aug 14 '20 at 9:58