Surface plot of Ackley function

This is an illuminated surface plot of an [inverted] Ackley function, often used as a test function for optimization algorithms.

gmt grdmath -R-5/5/-5/5 -I0.05 X Y HYPOT 0.5 0.5 POW MUL -0.2 MUL EXP -20 MUL 2 PI MUL X MUL COS 2 PI MUL Y MUL COS ADD 0.5 MUL EXP SUB E ADD 20 ADD -1 MUL 14.3026046753 ADD = data.grd
gmt grdview data.grd -Ba5f1 -Bza5f1 -Jx0.2i -Jz0.2i -Qs -Croma -p135/30 -I+ -png ackley

1 Like