Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Getting only 1 of 3 curves of intersection

  • To: mathgroup at smc.vnet.net
  • Subject: [mg126315] Re: Getting only 1 of 3 curves of intersection
  • From: "djmpark" <djmpark at comcast.net>
  • Date: Mon, 30 Apr 2012 04:43:43 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <1198356.198995.1335681120499.JavaMail.root@m06>

Bill,

Use Reduce:

Reduce[Cos[x y] == Sin[x y] && 0 <= y <= \[Pi], {x, y}, Reals] 

Then write ConditionalExpressions for the intersections.

intersection1[k_][x_] = 
  ConditionalExpression[{x, (-2 ArcTan[1 + Sqrt[2]] + 2 \[Pi] k)/x, 
    Sin[-2 ArcTan[1 + Sqrt[2]] + 2 \[Pi] k]}, (k <= 0 && 
      x <= (-2 ArcTan[1 + Sqrt[2]] + 2 \[Pi] k)/\[Pi]) || (k >= 1 && 
      x >= (-2 ArcTan[1 + Sqrt[2]] + 2 \[Pi] k)/\[Pi])]; 

intersection2[k_][x_] = 
  ConditionalExpression[{x, (-2 ArcTan[1 - Sqrt[2]] + 2 \[Pi] k)/x, 
    Sin[-2 ArcTan[1 - Sqrt[2]] + 2 \[Pi] k]}, (k <= -1 && 
      x <= (-2 ArcTan[1 - Sqrt[2]] + 2 \[Pi] k)/\[Pi]) || (k >= 0 && 
      x >= (-2 ArcTan[1 - Sqrt[2]] + 2 \[Pi] k)/\[Pi])];

The particular intersections you want for your plot are:

intersection2[0][x]
intersection2[1][x] 
intersection1[1][x] 

In Presentations I would draw this as:

<< Presentations` 

Draw3DItems[
 {{Opacity[0.6, ColorData["Crayola"]["RedViolet"]],
   Draw3D[Sin[x y], {x, 0, Pi}, {y, 0, Pi}, Mesh -> None]},
  {Opacity[0.6, Cyan],
   Draw3D[Cos[x y], {x, 0, Pi}, {y, 0, Pi}, Mesh -> None]},
  {Black, Thick,
   ParametricDraw3D[intersection2[0][x], {x, 0, \[Pi]}],
   ParametricDraw3D[intersection2[1][x], {x, 0, \[Pi]}],
   ParametricDraw3D[intersection1[1][x], {x, 0, \[Pi]}]}},
 NeutralLighting[0, 0.5, 0.4],
 NiceRotation,
 Axes -> True, AxesLabel -> {"x", "y", "z"},
 BoxRatios -> {1, 1, 0.5},
 ImageSize -> 500] 


David Park
djmpark at comcast.net 
http://home.comcast.net/~djmpark/index.html 


From: Bill [mailto:WDWNORWALK at aol.com] 


Hi:

Consider the following plot:

g1=Plot3D[Sin[x*y],{x,0,Pi},{y,0,Pi},PlotStyle->None,MeshStyle->Red,Axes->Tr
ue,AxesLabel->{"x","y","z"}];
g2=Plot3D[Cos[x*y],{x,0,Pi},{y,0,Pi},Mesh->None,PlotStyle->{Cyan,Opacity[.8]
}];
nsSol=NSolve[{z-Sin[x*y],z-Cos[x*y]},{y,z}];//Quiet
g3=ParametricPlot3D[{x,y,z}/.nsSol[[2]],{x,0,Pi},PlotStyle->{Magenta,Thickne
ss[.007]}];
Show[g1,g2,g3,Background->LightYellow,ImageSize->500]

Using the above Mathematica 8.0.4 code, I can plot one curve of intersection
shown in magenta. 
Within the plotted area, I can see 2 more places where intersection curves
should be.  
I've tried using Reduce in place of NSolve, but can't get it to work.

Question: If this can be done, can someone please give me the code?


Thanks,

Bill




  • Prev by Date: Re: Getting only 1 of 3 curves of intersection
  • Next by Date: Re: Creating 'smart' textbooks with mathematica?
  • Previous by thread: Re: Getting only 1 of 3 curves of intersection
  • Next by thread: Trouble plotting BSpline