Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Suppose I have this contour described by the equation the root $z$ of this equation $$ \frac{1}{x^2 + y^2} + \frac{1}{xz} = 2y $$

Now suppose the equation is tweaked slightly, with an addition of $w$, where $w$ is a number: $$w + \frac{1}{x^2 + y^2} + \frac{1}{xz} = 2y$$

eq1[x_, y_, z_]  :=  1/(x + y^2) + 1/(x*z) == 2 y
ContourPlot[
 z /. FindRoot[eq1[x, y, z], {z, 1}], {x, -5, 5}, {y, -5, 5}]

eq2[x_, y_, z_]  :=  2 + 1/(x + y^2) + 1/(x*z) == 2 y
ContourPlot[
 z /. FindRoot[eq2[x, y, z], {z, 1}], {x, -5, 5}, {y, -5, 5}]

eq3[x_, y_, z_]  :=  4 + 1/(x + y^2) + 1/(x*z) == 2 y
ContourPlot[
 z /. FindRoot[eq3[x, y, z], {z, 1}], {x, -5, 5}, {y, -5, 5}]

enter image description here

By visual inspection we see that the curves shift upwards as $w$ increases.

However, I need a better way to describe it. Is there a way to "differentiate the contour" to find the contour $\frac{\partial z}{\partial w}$?

Now suppose the equation is tweaked slightly, with an addition of $w$, where $w$ is a number.

Is there a way to "differentiate the contour" to find the contour $\frac{\partial z}{\partial w}$?

I tried "subtracting" the roots then plotting the contour, but mathematica can't seem to execute this:

eq1[x_, y_, z_] := 1/(x + y^2) + 1/(x*z) == 2 y
ContourPlot[
 z /. FindRoot[eq1[x, y, z], {z, 1}], {x, -5, 5}, {y, -5, 5}]

eq2[x_, y_, z_] := 2 + 1/(x + y^2) + 1/(x*z) == 2 y
ContourPlot[
 z /. FindRoot[eq2[x, y, z], {z, 1}], {x, -5, 5}, {y, -5, 5}]

sol[x_,y_] := FindRoot[eq2[x, y, z], {z, 1}] - FindRoot[eq1[x, y, z], {z, 1}]

ContourPlot[ sol[x,y], {x, -5, 5}, {y, -5, 5}]
share|improve this question
    
Dou you get what you need when you change the definition of sol[..] to sol[x_, y_] := (z /. FindRoot[eq2[x, y, z], {z, 1}]) - (z /. FindRoot[eq1[x, y, z], {z, 1}])? –  kguler Aug 15 at 19:53

1 Answer 1

Are you wanting to do this numerically or is symbolically fine for you? If so how about implicit differentiation:

Solve[D[w + 1/(x^2 + y^2) + 1/(x z[w]) == 2y, w], z'[w]]

(* {{z'[w] -> x z[w]^2}} *)
share|improve this answer
    
Also, I want to make the assumption that $ \frac{\partial x}{\partial w} = \frac{\partial y}{\partial w} = 0$. Also, z'[w] is a function of x,y,z. Don't we have to specify a value of z in order to plot the contours in axes x,y? –  user44840 Jul 16 at 7:45

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.