MathGroup Archive 2005

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

Search the Archive

Re: Crossing of 3D functions

  • To: mathgroup at
  • Subject: [mg57003] Re: Crossing of 3D functions
  • From: "Carl K. Woll" <carlw at>
  • Date: Thu, 12 May 2005 02:33:00 -0400 (EDT)
  • Organization: University of Washington
  • References: <d5sks6$o2t$>
  • Sender: owner-wri-mathgroup at

"Paawel" <fonfastik at> wrote in message 
news:d5sks6$o2t$1 at
> Hello
> I have two functions of surfaces
> F1=\!\(\(-7.516\)*\
>      Exp[\(-3.076\)*\((r - 1.184)\)]*\((1 -
>          8.28*10\^\(-5\)*\((180\  - \ f)\)\^2)\)*0.7\^0.5 +
>    3.758*Exp[\(-6.152\)*\((r - 1.184)\)] + 3.92\)
> and
> F2=\!\(\(-0.958\)*\ Exp[\(-4.993\)*\((r - 1.375)\)]*\((1 - \
> 1.07*10\^\(-3\)*\((133\  - \ f)\)\^2)\)*1\^0.5 + 0.479*
>          Exp[\(-9.986\)*\((r - 1.375)\)] + 0.479\)
> variables are r and f
> I want to find a plot which describes crossing of these functions.
> I tried Solve command but without any success
> I also tried a simpler example
> Fa=Exp[-(x^2 + y^2)]
> and
> Fb=0.5
> and when I used
> Solve[Fa == Fb, {y}]
> I received y1 and y2 - two parts of wanted function
> How to obtain one function (circle) from the above Fa nad Fb?
> Please Help
> Pawel

One idea is to use NDSolve to generate interpolating function solutions to 
your problem. Simply differentiate your problem, and then integrate using 
NDSolve with the appropriate initial conditions. You mention that you want 
one function encompassing the entire curve, and one way to achieve this is 
to parametrize your curve in terms of the arc length of the curve. That is, 
the answer will be {x[s],y[s]} where x[s] and y[s] are functions of the arc 
length. I will work with your simpler example. Let

g[x_,y_]:= Exp[ -(x^2+y^2)] - 0.5

so that you are interested in solving g[x,y]==0. One of the equations needed 
by NDSolve is found by expressing x and y as x[s] and y[s], where s is the 
arc length, and differentiating g[x[s],y[s]]. The second equation is simply 
the arc length equation dx^2+dy^2=ds^2, or x'[s]^2+y'[s]^2==1. We use 
NDSolve as follows:

    {D[g[x[s],y[s]],s]==0, x'[s]^2+y'[s]^2==1, x[0]==(-Log[0.5])^(1/2), 

NDSolve will return 2 solutions, one moving along the curve clockwise and 
one moving counterclockwise. For the initial conditions, I plugged in the 
point where y is zero (and so x is a somewhat ugly function of Log[0.5]). 
You may need to play with the endpoint of NDSolve, which is 5 in the above 
example, to get the full curve you are interested in.

We can see how the answer looks by using ParametricPlot:

ParametricPlot[Evaluate[{x[s],y[s]}/.curve[[1]]], {s,0,5}]

If you plug the above into Mathematica you will see a circle missing a small 
arc at the end, since the perimeter of the circle is a bit larger than 5.

For your problem, you will just need to define g[r_,f_]:=F1-F2, and find one 
of the points on the curve to use as an initial condition.

Carl Woll 

  • Prev by Date: Re: function definition difficulty
  • Next by Date: Re: NIntegrate-FindRoot acting up in version 5.1
  • Previous by thread: Re: Crossing of 3D functions
  • Next by thread: Re: Crossing of 3D functions