0
$\begingroup$

I have the following equations in $x$, $y$, $z$ coordinates:

$x = R_0[f(\theta,\phi)\sin(\theta)\cos(\phi) + \partial_{\theta}f(\theta,\phi)\cos(\theta)\cos(\phi) - \partial_{\phi}f(\theta,\phi)\sin(\phi)/\sin(\theta)]$

$y = R_0[f(\theta,\phi)\sin(\theta)\sin(\phi) + \partial_{\theta}f(\theta,\phi)\cos(\theta)\sin(\phi) + \partial_{\phi}f(\theta,\phi)\cos(\phi)/\sin(\theta)]$

$z = R_0[f(\theta,\phi)\cos(\theta) - \partial_{\theta}f(\theta,\phi)\sin(\theta)]$

with $f(\theta,\phi) = 1 + \frac{4\epsilon_e}{1-4\epsilon_e}[\cos^4(\theta) + \sin^4(\theta)(1 -2\sin^2(\phi)\cos^2(\phi))]$

where $\epsilon_e = 0.047, R_0 = 15 $. Here, $\theta,\phi$ are spherical angles

Now, I would like to plot $(x,y)$ for $\epsilon_e = 0.047$ and $0$

This is what I have tried:

f[\[Theta]_, \[Phi]_] := 
 1 + ((4 Subscript[\[Epsilon], e])/(
   1 - 3 Subscript[\[Epsilon], e]))[(
     Cos^4)[\[Theta]] + (
      Sin^4)[\[Theta]] (1 - 2 (Sin^2)[\[Phi]] (Cos^2)[\[Phi]] )]
x = Subscript[R, 0][
  f[\[Theta]_, \[Phi]_] Sin[\[Theta]] Cos[\[Phi]]  + 
   Diff[f[\[Theta]_, \[Phi]_], \[Theta]] Cos[\[Theta]] Cos[\[Phi]] - 
   Diff[f[\[Theta]_, \[Phi]_], \[Phi]] Sin[\[Phi]]/Sin[\[Theta]]]

y = Subscript[R, 0][
  f[\[Theta]_, \[Phi]_] Sin[\[Theta]] Sin[\[Phi]]  + 
   Diff[f[\[Theta]_, \[Phi]_], \[Theta]] Cos[\[Theta]] Sin[\[Phi]] + 
   Diff[f[\[Theta]_, \[Phi]_], \[Phi]] Cos[\[Phi]]/Sin[\[Theta]]]

z = Subscript[R, 0][
  f[\[Theta]_, \[Phi]_] Cos[\[Theta]] - 
   Diff[f[\[Theta]_, \[Phi]_], \[Theta]] Sin[\[Theta]]]

Can anyone suggest how to proceed forward to plot in XY-2D plane ? Do I have to use SphericalPlot or ListPlot?

$\endgroup$

1 Answer 1

2
$\begingroup$

Here we have corrected some error in the code.

Subscript[ϵ, e] = 0.047;
Subscript[R, 0] = 15;
f[θ_, ϕ_] := 
  1 + (4 Subscript[ϵ, e])/(1 - 
       3 Subscript[ϵ, e]) (Cos[θ]^4 + 
      Sin[θ]^4 (1 - 2 Sin[ϕ]^4 Cos[ϕ]^2));
x = Subscript[R, 
    0] (f[θ, ϕ] Sin[θ] Cos[ϕ] + 
     D[f[θ, ϕ], θ] Cos[θ] Cos[ϕ] - (D[
         f[θ, ϕ], ϕ] Sin[ϕ])/Sin[θ]);
y = Subscript[R, 
    0] (f[θ, ϕ] Sin[θ] Sin[ϕ] + 
     D[f[θ, ϕ], θ] Cos[θ] Sin[ϕ] + (D[
         f[θ, ϕ], ϕ] Cos[ϕ])/Sin[θ]);
z = Subscript[R, 
    0] (f[θ, ϕ] Cos[θ] - 
     D[f[θ, ϕ], θ] Sin[θ]);
ParametricPlot3D[{x, y, z}, {θ, 0, 2 π}, {ϕ, 0, 
  2 π}]

enter image description here

$\endgroup$
3
  • $\begingroup$ thanks. Could you point out what the error was ? And how to plot the xy plan of this fig. ? $\endgroup$
    – newstudent
    Apr 26, 2021 at 10:16
  • $\begingroup$ @newstudent ParametricPlot[{x, y}, {θ, 0, 2 π}, {ϕ, 0, 2 π}] $\endgroup$
    – cvgmt
    Apr 26, 2021 at 10:35
  • $\begingroup$ ParametricPlot[{x, y}, {θ, 0, π/2}, {ϕ, 0, 2 π}, ColorFunction -> Function[{x, y, θ, ϕ}, Hue[z]], ColorFunctionScaling -> False] $\endgroup$
    – cvgmt
    Apr 26, 2021 at 10:53

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.