I want to establish the electromagnetic field of the motor based on the finite element method, because the governing equations are different in different regions, so we need to first build the shape to divide the grid. I want to create poles and slots in polar coordinates, but using the following code and commands, Mathematica defaults to Cartesian coordinate points rather than the Polar coordinate, so how to set and change the coordinate to Polar?


ToothNumber = 3;
SlotNumber = ToothNumber - 1;
RectangleNumber = ToothNumber + SlotNumber;

ToothLength = 0.1;

ToothHeight = 0.1;
SlotHeight = 0.1;

coordinates = {{0., 0.}, {ToothLength, 0}, {ToothLength, 
    ToothHeight}, {2*ToothLength, ToothHeight}, {2*ToothLength, 
    0}, {3*ToothLength, 0}, {3*ToothLength, 
    ToothHeight}, {4*ToothLength, ToothHeight}, {4*ToothLength, 
    0}, {5*ToothLength, 0}, {5*ToothLength, 
    ToothHeight + SlotHeight}, {0, ToothHeight + SlotHeight}};

el1 = LineElement[{{1, 2}, {2, 3}, {3, 4}, {4, 5}, {5, 6}, {6, 7}, {7,
      8}, {8, 9}, {9, 10}, {10, 11}, {11, 12}, {12, 1}}];
bMesh2 = ToBoundaryMesh["Coordinates" -> coordinates, 
   "BoundaryElements" -> {el1}];

As I want to define all points in Polar coordinate completely, so the following command is not convenient:

CoordinateTransform[  "Cartesian"->"Polar",coordinates]
  • 1
    $\begingroup$ Why is CoordinateTransform inconvenient? Alternative Map[{Sqrt[# . #], ArcTan[#[[1]], #[[2]]]} &, coordinates]gives the same result! $\endgroup$ Mar 21 at 10:17
  • $\begingroup$ It is not what I want, I just want to define all the points in r and theta defination, so it is not the best way to use CoordinateTransform or the Map, the best way is to define all in polar coordinate at the beginning. And the CoordinateTransform sometimes give the indetermined result which is difficult for postprocess. $\endgroup$
    – fhrl
    Mar 22 at 1:41
  • 1
    $\begingroup$ Most importantly, the example I have used is in the Cartesian coordinate and if you line the points, the line is the direct line. However, how to expand the shape to polar coordinate and line the points in radial and tangential curve? $\endgroup$
    – fhrl
    Mar 22 at 2:35
  • 1
    $\begingroup$ The points doesn't change in different coordinates! You need to give additional information about the "curve" between the points. $\endgroup$ Mar 22 at 8:12


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.