Group Abstract Group Abstract

Message Boards Message Boards

Represent the intersection curve between a sphere and a paraboloid

Posted 5 years ago
POSTED BY: Robert Poenaru
7 Replies
POSTED BY: Hans Dolhaine

But perhaps this is it what is asked for

s5 = Flatten[FullSimplify[Solve[surface1 == R^2, \[Theta]]]];
plot7 = ParametricPlot3D[
  {x1[R, \[Theta], \[Phi]], x2[R, \[Theta], \[Phi]], 
      x3[R, \[Theta], \[Phi]]} /. # & /@ s5,
  {\[Phi], 0, Pi},
  PlotStyle -> {Thick, Blue}]

or

s6 = Flatten[FullSimplify[Solve[surface1 == R^2, \[Phi]]]];
plot6 = ParametricPlot3D[{x1[R, \[Theta], \[Phi]], 
      x2[R, \[Theta], \[Phi]], x3[R, \[Theta], \[Phi]]} /. # & /@ s6,
  {\[Theta], 0, Pi}, PlotStyle -> {Thick, Blue}]
POSTED BY: Hans Dolhaine

I think

s2 = Solve[eqs2[r, \[Theta], \[Phi]] == R^2, r][[2]] // Simplify;

is not appropriate. We are looking for an intersection of the paraboloid and the sphere. All these points are elements of the spherical surface and therefore have a r-value of R, so we must not look for r.

The intersection being a line means that it is a one-dimensional entity, depending only on ONE pararmeter. So I think fixing r to the radius of the sphere we should ask for theta as function of phi or phi as function of theta and insert this in the representation of a point:

For example

s3 = Solve[eqs1[R, \[Theta], \[Phi]] == R^2, \[Phi]]
Length[s3]
plot3 = ParametricPlot3D[{x1[R, \[Theta], \[Phi]], 
    x2[R, \[Theta], \[Phi]], x3[R, \[Theta], \[Phi]]} /. 
   s3[[5, 1]], {\[Theta], 0, Pi},
  PlotStyle -> {Thick, Blue}]
Show[plot2, plot3]

or

s4 = Solve[eqs1[R, \[Theta], \[Phi]] == R^2, \[Theta]]
Length[s4]
plot4 = ParametricPlot3D[{x1[R, \[Theta], \[Phi]], 
    x2[R, \[Theta], \[Phi]], x3[R, \[Theta], \[Phi]]} /. 
   s4[[6, 1]], {\[Phi], 0, 2 Pi},
  PlotStyle -> {Thick, Blue}]
Show[plot2, plot4]

As s3 and s4 yield several solutions it seems that the intersection is given piecewise. But put together it seems that both solutions are equivalent, as it should be:

plot5= ParametricPlot3D[
{x1[R, \[Theta], \[Phi]], x2[R, \[Theta], \[Phi]], 
x3[R, \[Theta], \[Phi]]} /. # & /@ Flatten[s3],
{\[Theta], 0, Pi},
PlotStyle -> {Thick, Blue}]

plot6= ParametricPlot3D[{x1[R, \[Theta], \[Phi]], x2[R, \[Theta], \[Phi]], 
x3[R, \[Theta], \[Phi]]} /. # & /@ Flatten[Drop[s4, 3]],
{\[Phi], 0, 2 Pi}, PlotStyle -> {Thick, Blue}]

Show[plot2, plot5, plot6]
POSTED BY: Hans Dolhaine

Thank you again! This solution works like a charm!

Best Regards

POSTED BY: Robert Poenaru

This seems to work:

eqs1[e_, u_, v_] = Last@Solve[Hsim[r, \[Theta], \[Phi], u, v] == e, r];
surface1[e_, u_, v_] := r /. eqs1[e, u, v];
Manipulate[
 Show[Graphics3D[{Red, Sphere[{0, 0, 0}, 9.5]}], 
  SphericalPlot3D[9.5, {\[Theta], 0, \[Pi]}, {\[Phi], 0, 2 \[Pi]}, 
   PlotStyle -> None, 
   MeshFunctions -> {Function[{x, y, z, \[Theta], \[Phi], r}, 
      Evaluate[Hsim[r, \[Theta], \[Phi], up, v0p]]]}, Mesh -> {{e}}, 
   MeshStyle -> Directive[Yellow, Thick], PlotPoints -> 50, 
   BoundaryStyle -> None],
  SphericalPlot3D[
   surface1[e, up, v0p], {\[Theta], 0, \[Pi]}, {\[Phi], 0, 2 \[Pi]}, 
   PlotStyle -> Directive[Blue, Opacity[0.5]], Mesh -> None, 
   PlotPoints -> 40],
  PlotRange -> 13],
 {e, 0, 50, 2}]
POSTED BY: Gianluca Gorni

@Gianluca thank you so much for the answer!!!
Your solution works as intended for me, however, now I took the problem to another level and I am facing an issue that I can't solve.
In my initial problem, my second surface was a sphere, and the first one a basic paraboloid. The equation of the paraboloid was straightforward.
Now, I still have the sphere, but the paraboloid is parameterized by three numbers (in the code: e, u and v).

Hsim[r_, theta_, fi_, u_, v_] := 
  x2[r, theta, fi]^2 + u*x3[r, theta, fi]^2 + 2 v*x1[r, theta, fi];
eqs1[e_, u_, v_] := NSolve[Hsim[r, \[Theta], \[Phi], u, v] == e, r];
surface1[e_, u_, v_] := r /. eqs1[e, u, v][[2]];

I did the same thing and defined surface1 as being the solution to an equation, but this time the equation is Hsim[r,\theta,\phi,e,u,v]==e, which again I have to solve for r.

The problem is in the MeshFunction. If I try in the same manner MeshFunction -> Function[{x, y, z, r, \[Theta], \[Phi]}, Evaluate[surface1[e, up, v0p]]], I don't get the intersection curve (ellipse) between the sphere and the paraboloid.
e is just a number that I can modify in a Manipulate, to see how the intersection curve modifies with the increase if this value. The parameters u,v (denoted in the document with up, and v0p are know beforehand). What is the issue here?

PS: I even tried putting the analytic form of the surface in the MeshFunction like so:

MeshFunctions -> {Function[{x, y, z, 
    r, \[Theta], \[Phi]}, (0.3431771859697404` (7.3454135`*^7 Cos[\
\[Theta]] + 
         1.96286546`*^8 Sqrt[
          0.14003978386304503` Cos[\[Theta]]^2 + 
           4.` e Cos[\[Phi]]^2 Sin[\[Theta]]^2 + 
           0.3582649439870417` e Sin[\[Theta]]^2 \
Sin[\[Phi]]^2]))/(1.34722129`*^8 Cos[\[Phi]]^2 Sin[\[Theta]]^2 + 
       1.2066554`*^7 Sin[\[Theta]]^2 Sin[\[Phi]]^2) /. {e -> e}]}

But the lines that I get are not ok.


I attached here a simple document with the example. My first manipulate is without the MeshFunction, and that works fine. The second Manipulate is where I try to implement the intersection curves, unsuccessfully.

Attachments:
POSTED BY: Robert Poenaru

You can draw the intersection with MeshFunctions:

eqs1[r_, theta_, fi_] := 
  A1*x1[r, theta, fi]^2 + A2*x2[r, theta, fi]^2 + 
   A3*x3[r, theta, fi];
s1 = Solve[eqs1[r, \[Theta], \[Phi]] == R^2, r][[2]];
surface1 = r /. s1;
eqs2[r_, theta_, fi_] := 
  x1[r, theta, fi]^2 + x2[r, theta, fi]^2 + x3[r, theta, fi]^2;
s2 = Solve[eqs2[r, \[Theta], \[Phi]] == R^2, r][[2]] // Simplify;
surface2 = r /. s2;
SphericalPlot3D[{surface1, surface2}, {\[Theta], 0, \[Pi]}, {\[Phi], 
  0, 2 \[Pi]}, PlotStyle -> {Directive[Blue, Opacity[0.3]], Red}, 
 MeshFunctions -> {Function[{x, y, z, \[Theta], \[Phi], r}, 
    Evaluate[surface1]]}, Mesh -> {{4}}, BoundaryStyle -> None, 
 MeshStyle -> Thick, PlotPoints -> 50]
POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard