3
$\begingroup$

So I have some minima of a function which I found by brute force, whose xy coordinates are given below in coord and their value is given in energies.

Because of the symmetry of the function I am minimising, I am only performing the optimisation in a region between 0 and 45 degrees.

1) In the CountourPlot, I am using coords to plot Points at those positions, in the Epilog. How can I rotate them about the origin (8 times, 45 degrees each time), so that I see the fully symmetric picture?

2) In the ListPointPlot3D I am plotting their value vs. xy plane, so that I can fit a Gaussian to it or something. How can I rotate the xy coordinates in the same way as above, but also such that the values at those points are carried over?

Code:

coords = {{0.6190336712698862`, 0}, {1.8602613403366641`, 
    1.0245504661458222`}, {2.0398699908107805`, 
    0.5909368262516823`}, {2.0624401421510528`, 
    0}, {1.456538407177356`, 0}, {1.02708081178471`, 
    0.4254308018943951`}, {1.4668764036170645`, 0.6076001007032582`}}; 

energies = {6.934067103095236`, 6.096006662217476`, 
   6.096006662217476`, 8.286935949864931`, 8.617671780484468`, 
   7.809519828670573`, 6.557138040453592`};

RealPotential[x_, y_] := x^2 + y^2

ContourPlot[RealPotential[x, y], {x, -4, 4}, {y, -4, 4}, 
 ImageSize -> Scaled[0.3], ColorFunction -> "DarkTerrain", 
 Contours -> 15, 
 Epilog -> {AbsolutePointSize[6], {Opacity[0], Cyan, 
    Point[coords]}, {Cyan, Point[coords]}}]

bla = Table[
   Flatten[{coords[[n]], energies[[n]]}], {n, 1, Length[energies]}];

ListPointPlot3D[bla, PlotRange -> Full, ImageSize -> 500]
$\endgroup$
  • $\begingroup$ RotationTransform[π/4]@coords would be a place to start $\endgroup$ – Jason B. May 9 '18 at 21:25
3
$\begingroup$
coords2 = Join @@ NestList[RotationTransform[π/4], coords, 7]; 
ContourPlot[RealPotential[x, y], {x, -4, 4}, {y, -4, 4}, 
 ImageSize -> Scaled[0.3], ColorFunction -> "DarkTerrain", 
 Contours -> 15, Epilog -> {AbsolutePointSize[6], Cyan, Point@coords2}]

enter image description here

bla2 = Join @@ (Flatten /@ Thread[{NestList[RotationTransform[π/4], {#, #2}, 7], #3}]& @@@
   bla);
ListPlot3D[bla2, PlotRange -> Full, ImageSize -> 500]

enter image description here

| improve this answer | |
$\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.