Message Boards Message Boards

[✓] Avoid FindRoot function error?

GROUPS:

Hi, I'm trying to run this code. When I evaluate the notebook, it didn't go through. But if I shift-entered it later, it worked. I'm solving a LaGrange problem.

{x, y, lambda} /. 
 FindRoot[{mx[x, y] == lambda*rx[x, y] , my[x, y] == lambda*ry[x, y], 
   r[x, y] == 1}, {{x, 3.5}, {y, 1.3}, {lambda, 1}}]
(* FindRoot: The function value {-0.617284+mx[3.5,1.3],0.972222 \
+my[3.5,1.3],-0.35108} is not a list of numbers with dimensions {3} \
at {x,y,lambda} = {3.5`,1.3`,1.`}"
ReplaceAll::reps: {FindRoot[{mx[x,y]==lambda rx[x,y],my[x,y]==lambda ry[x,y],r[x,y]==1},{{x,3.5},{y,1.3},{lambda,1}}]} is neither a list of replacement rules nor a valid dispatch table, and so cannot be used for replacing. *)

Thank you

POSTED BY: A N
Answer
3 months ago

From the message, it looks like mx[3.5,1.3] and my[3.5,1.3] are undefined.

POSTED BY: Michael Rogers
Answer
3 months ago

Group Abstract Group Abstract