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?
Needs["NDSolve`FEM`"];
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}];
GraphicsRow[{bMesh2["Wireframe"]}]
As I want to define all points in Polar coordinate completely, so the following command is not convenient:
CoordinateTransform[ "Cartesian"->"Polar",coordinates]
CoordinateTransform
inconvenient? AlternativeMap[{Sqrt[# . #], ArcTan[#[[1]], #[[2]]]} &, coordinates]
gives the same result! $\endgroup$CoordinateTransform
or the Map, the best way is to define all in polar coordinate at the beginning. And theCoordinateTransform
sometimes give the indetermined result which is difficult for postprocess. $\endgroup$