2
$\begingroup$

I've been working on some simple scripts to find critical points. I've been using this one.

enter image description here

Where the red script is the particular function I'm interested in.

But I am struggling to find a way to calculate the critical points when the domain and/or range is limited.

For example, I'm interested in finding the critical points of f(x,y) = sin(x)sin(y) ,f[x_,y_]=Sin[x] Sin[y], where -pi =< x =< pi, and -pi =< y =< pi. Here's the code I use, and, absent the limits on x and y, it gives a wild unusable answer. But I get errors when I try to mess around with limiting x and y to their respective range and domain. Here's the basic function, sans limits on x and y.

ResourceFunction["StationaryPoints"][Sin[x] Sin [y], {x, y}]

Any thoughts?

$\endgroup$
1
  • $\begingroup$ Try e.g.: Solve[{Grad[f[x, y], {x, y}] == 0, -Pi <= x <= Pi, -Pi <= y <= Pi}, {x, y}] $\endgroup$ – Daniel Huber Dec 16 '20 at 12:16
1
$\begingroup$
ResourceFunction[
  "StationaryPoints"][{Sin[x]*
   Sin[y], -π <= x <= π && -π <= y <= π}, {x, y}]

<|"Saddle" -> {{0, {x -> 0, y -> 0}}, {0, {x -> 0, y -> -π}}, {0, {x -> 0, y -> π}}, {0, {x -> -π, y -> 0}}, {0, {x -> -π, y -> -π}}, {0, {x -> -π, y -> π}}, {0, {x -> π, y -> 0}}, {0, {x -> π, y -> -π}}, {0, {x -> π, y -> π}}}, "Maxima" -> {{1, {x -> -(π/2), y -> -(π/2)}}, {1, {x -> π/2, y -> π/2}}}, "Minima" -> {{-1, {x -> -(π/2), y -> π/2}}, {-1, {x -> π/2, y -> -(π/2)}}}|>

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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