|
"m y" <ailojee@gmail.com> wrote in message <gk4rkc$94k$1@fred.mathworks.com>...
> Hi dears
> How to plot a level curve and the exact point of intersection between two different level curves.
> I ploted the level curves and their point of intersection but that is not exact.
>
> f(x,y)=m (first level curve with m as a parameter)
> g(x,y)=n (second level curve with n as a parameter)
> in both cases x and y varies from 0 to 1.
> one way is
> We will fix one level curve (say for m=0.5), and check the level curve intersection for n zero to 1. similarly we change m and again check the point of intersection b/W these level curves.
>
> I am interested in the tangential situation,I need those values of (x,y)where both curves are tangent to eachother.
For your tangential problem, as Bruno states, the level curves will be tangent at an intersection provided their respective gradient directions are parallel, or equivalently, provided their tangent vectors are parallel. If you possess partial derivatives for f and g, this can be expressed as df/dx*dg/dy = df/dy*dg/dx. This gives a single condition to be satisfied and therefore in general represents some sort of one-dimensional curve. To find such a curve, all I can think of is to set one of the parameters m or n, or one of the coordinates x or y, to various discrete values and use something like 'fsolve' to use the two corresponding equations to find the coordinates x and y. Repeated calls to 'fsolve' would then presumably find your "tangential" curve as a series of x and y pairs. As John has stated, it doesn't sound like an easy problem,.
As for the non-tangential intersections between the level curves, every point (x,y) is an intersection for some m and n. Just evaluate f(x,y) = m and g(x,y) = n and you have an intersection. Presumably you would like to find such intersections in terms of, say, a mesh of discrete m and n pairs, which would be another way to use 'fsolve' repeatedly. Very repeatedly indeed; each m, n pair would require a call!
If you only know f(x,y) and g(x,y) for a discrete set of x,y pairs, the problem becomes even more difficult. You would have to set up some sort of function that 'fsolve' could call on which involves a table of these known discrete pair values along with a two dimensional interpolation formula to be used in a vector manner. Not easy to do and very time consuming.
Roger Stafford
|