I have a function f[x,y,...,z]
and I want to restrict its range to positive numbers only, f > 0
. f[x,y,...,z]
is multivalued for some x,y,...,z
and I cannot plot it for these values. How can I restrict the range?
To clarify, I don't want to restrict the range of a plot of the function, I want to restrict the range of the function itself.
I've tried Assuming[f>0, f[x,y,...,z]=(function)]
but that hasn't helped.
Here is the definition of f
, which I originally didn't supply because it's rather complicated:
f[∏, G, M, v, R, A, L] = Abs[1.` v + (12.355667760004051` G M + 1235.5667760004053` M R)/(Sqrt[
1.` + 0.0001` G^2] (Abs[(994964.5401209999` A^2 G M v)/Sqrt[
1.` + 0.0001` G^2] + (9.949645401209998`*^7 A^2 M R v)/Sqrt[
1.` + 0.0001` G^2] -
1.0145762999999998`*^7 A^2 \[CapitalPi] +
101457.62999999999` A^2 L \[CapitalPi] + \[Sqrt]((1.35`*^7 \(12.023014199999999` A G M + 1202.30142` A M R)^3)/(1.` +
0.0001` G^2)^(3/2) +
1/(10000.` + 1.` G^2)
9.899544360981928`*^15 A^4 (1.` G M v + 100.` M R v +
0.10197110138986612` Sqrt[
1.` + 0.0001` G^2] (-99.99999999999999` +
1.` L) \[CapitalPi])^2)])^(1/3)) - 1/A 0.004315935432213702` (Abs[(994964.5401209999` A^2 G M v)/Sqrt[
1.` + 0.0001` G^2] + (9.949645401209998`*^7 A^2 M R v)/Sqrt[
1.` + 0.0001` G^2] - 1.0145762999999998`*^7 A^2 \[CapitalPi] +
101457.62999999999` A^2 L \[CapitalPi] + \[Sqrt]((
1.35`*^7 (12.023014199999999` A G M +
1202.30142` A M R)^3)/(1.` + 0.0001` G^2)^(3/2) +
1/(10000.` + 1.` G^2)
9.899544360981928`*^15 A^4 (1.` G M v + 100.` M R v +
0.10197110138986612` Sqrt[
1.` + 0.0001` G^2] (-99.99999999999999` +
1.` L) \[CapitalPi])^2)])^(1/3)];
It's negative values of G
(which are necessary to my project) that make the function multivalued (this is the function that solves $∏ = af^3+bf^2+cf+d$ for appropriate $a$,$b$,$c$,$d$.
This is the plot I am now getting:
As you can see Mathematica adds a straight line instead of graphing the function when it becomes multivalued. I even asked Mathematica for the value of the function at Pi=100
and got the value of that line, so Mathematica is defining the function weirdly, not just plotting it weirdly.
f
, it's hard to decide how you would go about doing this. $\endgroup$