3
$\begingroup$

I'm trying to make a plot that depends on an implicit function. This example illustrates the problem: plot $c=2l +n$ in the $c \times l$ axes, where $n$ is implicitly determined by $n^5+ 2n = c^2$. Any ideas on how to do it?

$\endgroup$

3 Answers 3

6
$\begingroup$
Clear["Global`*"]

eqn = Eliminate[{c == 2*l + n, n^5 + 2*n == c^2}, n] // Simplify

(* c (2 + c^4 + 40 c^2 l^2 + 80 l^4) == 
 10 c^4 l + c^2 (1 + 80 l^3) + 4 (l + 8 l^5) *)

ContourPlot[
 Evaluate@eqn, {c, -10, 10}, {l, -10, 10},
 FrameLabel -> (Style[#, 14, Bold] & /@ {"c", "l"})]

enter image description here

$\endgroup$
5
$\begingroup$

As long as your condition is a polynomial you could use Root

 Plot[(c-n)/2 /.{n -> Root[#^5+2*#-c^2,1]},{c,-5,5},AxesLabel->{"c","l"}]

enter image description here

$\endgroup$
4
$\begingroup$
spacecurve = 
  ContourPlot3D[
   c == 2*l + n, {c, -10, 10}, {l, -10, 10}, {n, -10, 10}, 
   MeshFunctions -> Function[{c, l, n}, n^5 + 2*n - c^2], 
   Mesh -> {{0}}, Mesh -> Red, BoundaryStyle -> None, 
   ContourStyle -> None, Boxed -> False, Axes -> False];
Graphics[First@spacecurve /. {c_Real, l_Real, n_Real} -> {c, l}]

Or

reg = ImplicitRegion[{c == 2 l + n , n^5 + 2 n == c^2}, {c, l, n}];
eqn = Resolve[Exists[n, Element[{c, l, n}, reg]], Reals]
ContourPlot[eqn // Evaluate, {c, -10, 10}, {l, -10, 10}]
$\endgroup$

Your Answer

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

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