TransWikia.com

ContourPlot and MeshFunctions issue between versions 11.3 and 12.0

Mathematica Asked on May 17, 2021

On Mathematica 11.3

This code produces the image below (a set of points that I am then using as a pattern for FindRoot):

IIges[x_, y_] := Sin[x]^2 + Sin[y]^2;
xm = 4;

{dx[x_, y_], dy[x_, y_]} = D[IIges[x, y], {{x, y}}]; 
ContourPlot[dx[x, y] == 0, {x, -xm, xm}, {y, -xm, xm}, 
 ContourStyle -> None, Mesh -> {{0}}, 
 MeshFunctions -> Function[{x, y, z}, dy[x, y]]]

enter image description here

On Mathematica 12.0

The same code produces nothing ! Why??

enter image description here

One Answer

Try this:

IIges[x_, y_] := Sin[x]^2 + Sin[y]^2;
xm = 4; {dx[x_, y_], dy[x_, y_]} = D[IIges[x, y], {{x, y}}]; 
ContourPlot[{dx[x, y], dy[x, y]} == 0, {x, -xm, xm}, {y, -xm, xm}, 
ContourStyle -> None, Mesh -> {{0.}}, MeshFunctions -> {dx[#, #] &, dy[#, #] 
&}, MeshStyle -> Directive[PointSize[0.009], GrayLevel[0.5]], 
LabelStyle -> Directive[Black, Small]]

enter image description here

Another way:

IIges[x_, y_] := Sin[x]^2 + Sin[y]^2;
xm = 4; {dx[x_, y_], dy[x_, y_]} = D[IIges[x, y], {{x, y}}];
ContourPlot[{dx[x, y], dy[x, y]} == 0, {x, -xm, xm}, {y, -xm, xm}, 
ContourStyle -> None, Mesh -> {{0}}, MeshFunctions -> {#1 &, #2 &, dy[#1, #2] &}, 
MeshStyle -> Directive[PointSize[0.009], GrayLevel[0.5]], 
LabelStyle -> Directive[Black, Small]]

In the next page MeshFunctions. Also try changing MeshFunctions -> {#1 &, #2 &, dy[#1, #2] &} to MeshFunctions -> {x, y, z, dy[x, y]} and see the warning message it sends you.

Correct answer by E. Chan-López on May 17, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP