Message Boards Message Boards

GROUPS:

Find the root of a function with two variables?

Posted 1 year ago
1778 Views
|
3 Replies
|
0 Total Likes
|

I have this equation :

w[s_, u_] := 1 + (1 + 0.65 s - 1.2 s^2 - 0.4 s^3 + 0.35 s^4) Cos[u] + (1.4 s - 0.4 s^2 - 1.5 s^3 - 0.35 s^4) Sin[u];

And I need to find the critical point of this equation; The requirement is using the ContourPlot and FindRoot to solve it, so I need to give the FindRoot function an initial guess for a critical point; I can see the initial guess now, but how to find the "Find Root function" ?

If I try:

FindRoot[w[s, u], {s, 0}, {u, pi}]

,then the error message: " The number of equations does not match the number of variables in FindRoot[w[s,u],{s,0},{u,[Pi]}]."

Please help, Thank you!

enter image description here

3 Replies

In this case I would try FindMaximum:

FindMaximum[w[s, u], {s, .3}, {u, .1}]

For exact symbolic solutions you can use Reduce:

Reduce[Grad[Rationalize[w[s, u]], {s, u}] == 0 &&
  -1 < s < 1 &&
  -1 < u < 1,
 {s, u}, Reals]
% // N

It is not w that you want to be zero, but its gradient:

FindRoot[Grad[w[s, u], {s, u}] == 0, {s, 0}, {u, Pi}]
Posted 1 year ago

Thank you for your help!

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