Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- f[x_, y_] := (x - 2)^2 + x ( y - 2)^2
- FindRoot[{D[f[xs, y], xs] == 0 /. xs -> x,
- D[f[x, ys], ys] == 0 /. ys -> y}, {{x, 1}, {y, 3}}]
- (* {x -> 2., y -> 2.} *)
- FindRoot[{D[f[xs, y], xs] == 0 /. xs -> x,
- D[f[x, ys], ys] == 0 /. ys -> y}, {{x, 3}, {y, 20}}]
- (* {x -> -4.73317*10^-30, y -> 4.} *)
- fy[x_] := FindRoot[{D[f[x, ys], ys] == 0 /. ys -> y}, {{y, 20}}]
- FindRoot[{D[f[xs, y], xs] == 0 /. xs -> x /. fy[x]}, {{x, 2}}]
- FindRoot::nlnum: The function value {36. x} is not a list of numbers with dimensions {1} at {y} = {20.}.
- FindRoot[{D[f[xs, fy[xs]], xs] == 0 /. xs -> x /. fy[x]}, {{x, 2}}]
- FindRoot[{D[f[xs, fy[x]], xs] == 0 /. xs -> x /. fy[x]}, {{x, 2}}]
Advertisement
Add Comment
Please, Sign In to add comment