Message Boards Message Boards

0
|
3147 Views
|
1 Reply
|
1 Total Likes
View groups...
Share
Share this post:

[?] Avoid FindRoot function error?

Posted 6 years ago

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

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

POSTED BY: Michael Rogers
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract