Skip to content

Commit f17c054

Browse files
committed
[CO] Updating tutorials
1 parent d41f2a9 commit f17c054

File tree

2 files changed

+41
-44
lines changed

2 files changed

+41
-44
lines changed

Tutorials/tuto_Elec.ipynb

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,12 @@
6464
"cell_type": "markdown",
6565
"metadata": {},
6666
"source": [
67-
"The flux linkage and the magnetic inductances are computed using FEMM simulations: the `FluxLinkFEMM` and `IndMagFEMM` allow to define the FEMM simulations (symmetries and number of time steps). For the flux linkage computation, the currents are set to 0A.\n",
67+
"## Electrical Equivalent Circuit (EEC)\n",
68+
"The electrical module is defined with the object EEC_PMSM that correspond to the **electrical equivalent circuit** from \"Advanced Electrical Drives, analysis, modeling, control\", Rik de doncker, Duco W.J. Pulle, Andre Veltman, Springer edition, is then used for the computation of Ud/Uq or Id/Iq (see schematics hereafter). \n",
6869
"\n",
69-
"The **electrical equivalent circuit** from \"Advanced Electrical Drives, analysis, modeling, control\", Rik de doncker, Duco W.J. Pulle, Andre Veltman, Springer edition, is then used for the computation of Ud/Uq or Id/Iq (see schematics hereafter). The electrical torque is then computing according to the formula: $T_{em}=\\frac{P-RI^2}{\\Omega}$, where $P$ is the magnetic power $P=\\frac{q_s}{2}\\Re(VI^*)$"
70+
"The parameters from the EEC are first computed according to the `FluxLinkFEMM` and `IndMagFEMM` objects. They enable to compute the flux linkage and the magnetic inductances using FEMM simulations (with symmetries and number of time steps). For the flux linkage computation, the currents are set to 0A.\n",
71+
"\n",
72+
"Once the parameter of the EEC known, the voltage can be computed. The electrical torque is then computed according to the formula: $T_{em}=\\frac{P-RI^2}{\\Omega}$, where $P$ is the magnetic power $P=\\frac{q_s}{2}\\Re(VI^*)$"
7073
]
7174
},
7275
{
@@ -120,7 +123,7 @@
120123
"\n",
121124
"The starting point of the simulation is defined with InputElec or InputCurrent. These objects will create an \"OutElec\" object and initialize it with the provided values for Id/Iq, and/or Ud/Uq with InputElec. InputCurrent enables to define in several ways the starting point (see \"[How to set the Operating Point](https://pyleecan.org/tuto_Machine.html)\").\n",
122125
"\n",
123-
"Note that Id/Iq are required to accurately compute the magnetic inductances, so that if only Ud/Uq is provided, a current Id=1A and Iq=1A will be used for the computation of Ld and Lq. A more satisfactory method would be to compute a map of Ld and Lq over Id/Iq. Future developments would be welcome."
126+
"Note that Id/Iq are required to accurately compute the magnetic inductances, so that if only Ud/Uq is provided, a current Id=1A and Iq=1A will be used for the computation of Ld and Lq. A more satisfactory method would be to compute a map of Ld and Lq over Id/Iq. Future developments would be welcomed."
124127
]
125128
},
126129
{
@@ -277,7 +280,7 @@
277280
"cell_type": "markdown",
278281
"metadata": {},
279282
"source": [
280-
"Once the simulation is done, several postprocessings are available:"
283+
"Once the simulation is done, the torque as a function of Phi0 can be plotted with:"
281284
]
282285
},
283286
{
@@ -337,4 +340,4 @@
337340
},
338341
"nbformat": 4,
339342
"nbformat_minor": 4
340-
}
343+
}

Tutorials/tuto_Simulation_FEMM.ipynb

Lines changed: 33 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"output_type": "display_data",
3939
"data": {
4040
"text/plain": "<IPython.core.display.HTML object>",
41-
"text/html": "<div id='05be0942-5075-4058-b88c-78a13b8ff65b'></div>"
41+
"text/html": "<div id='727ce7fe-0f63-49f4-9277-3d53bf33114f'></div>"
4242
},
4343
"metadata": {}
4444
}
@@ -103,7 +103,7 @@
103103
"mySimu.input.N0 = 2000\n",
104104
"\n",
105105
"# time discretization [s]\n",
106-
"mySimu.input.time= linspace(start=0, stop=60/mySimu.input.N0, num=16, endpoint=False)# 16 timesteps\n",
106+
"mySimu.input.time = linspace(start=0, stop=60/mySimu.input.N0, num=16, endpoint=False) # 16 timesteps\n",
107107
"\n",
108108
"# Angular discretization along the airgap circonference for flux density calculation\n",
109109
"mySimu.input.angle = linspace(start = 0, stop = 2*pi, num=2048, endpoint=False) # 2048 steps \n",
@@ -135,7 +135,7 @@
135135
"cell_type": "markdown",
136136
"metadata": {},
137137
"source": [
138-
"The stator currents are enforced as a function of time for each phase. The current can also be enforced sinusoïdal by using Id_ref/Iq_ref as explained in the [How to set the Operating Point tutorial](https://www.pyleecan.org/tuto_Elec.html).\n",
138+
"The stator currents are enforced as a function of time for each phase. The current can also be enforced sinusoïdal by using Id_ref/Iq_ref as explained in the [How to set the Operating Point tutorial](https://www.pyleecan.org/tuto_Operating_point.html).\n",
139139
"\n",
140140
"### MagFEMM configuration\n",
141141
"For the configuration of the Magnetic module, we use the object [**MagFEMM**](https://www.pyleecan.org/pyleecan.Classes.MagFEMM.html) that compute the airgap flux density by calling FEMM. The model parameters are set though the properties of the [**MagFEMM**](https://www.pyleecan.org/pyleecan.Classes.MagFEMM.html) object. In this tutorial we will present the main ones, the complete list is available by looking at [**Magnetics**](http://www.pyleecan.org/pyleecan.Classes.Magnetics.html) and [**MagFEMM**](http://www.pyleecan.org/pyleecan.Classes.MagFEMM.html) classes documentation.\n",
@@ -213,26 +213,9 @@
213213
"cell_type": "code",
214214
"execution_count": 6,
215215
"metadata": {},
216-
"outputs": [
217-
{
218-
"output_type": "error",
219-
"ename": "ValueError",
220-
"evalue": "matmul: Input operand 1 has a mismatch in its core dimension 0, with gufunc signature (n?,k),(k,m?)->(n?,m?) (size 3 is different from 16)",
221-
"traceback": [
222-
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
223-
"\u001b[1;31mValueError\u001b[0m Traceback (most recent call last)",
224-
"\u001b[1;32m<ipython-input-6-cd7bedb9114e>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0mpyleecan\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mClasses\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mOutput\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mOutput\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 2\u001b[0m \u001b[0mmyResults\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mOutput\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0msimu\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mmySimu\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 3\u001b[1;33m \u001b[0mmySimu\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mrun\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
225-
"\u001b[1;32md:\\GitHub\\pyleecan\\pyleecan\\Methods\\Simulation\\Simulation\\run.py\u001b[0m in \u001b[0;36mrun\u001b[1;34m(self)\u001b[0m\n\u001b[0;32m 41\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 42\u001b[0m \u001b[1;31m# Compute the simulation\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 43\u001b[1;33m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mrun_single\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 44\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 45\u001b[0m \u001b[1;32mreturn\u001b[0m \u001b[0mresults\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
226-
"\u001b[1;32md:\\GitHub\\pyleecan\\pyleecan\\Methods\\Simulation\\Simu1\\run_single.py\u001b[0m in \u001b[0;36mrun_single\u001b[1;34m(self)\u001b[0m\n\u001b[0;32m 20\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 21\u001b[0m \u001b[1;31m# Init the input of the first module\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 22\u001b[1;33m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0minput\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mgen_input\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 23\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 24\u001b[0m \u001b[1;31m# Run the modules\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
227-
"\u001b[1;32md:\\GitHub\\pyleecan\\pyleecan\\Methods\\Simulation\\InputCurrent\\gen_input.py\u001b[0m in \u001b[0;36mgen_input\u001b[1;34m(self)\u001b[0m\n\u001b[0;32m 111\u001b[0m )\n\u001b[0;32m 112\u001b[0m \u001b[1;31m# Compute corresponding Id/Iq reference\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 113\u001b[1;33m \u001b[0mIdq\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mn2dq\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0moutput\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mIs\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mvalues\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m2\u001b[0m \u001b[1;33m*\u001b[0m \u001b[0mpi\u001b[0m \u001b[1;33m*\u001b[0m \u001b[0moutput\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mfelec\u001b[0m \u001b[1;33m*\u001b[0m \u001b[0moutput\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mtime\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 114\u001b[0m \u001b[0moutput\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mId_ref\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mmean\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mIdq\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 115\u001b[0m \u001b[0moutput\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mIq_ref\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mmean\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mIdq\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m1\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
228-
"\u001b[1;32md:\\GitHub\\pyleecan\\pyleecan\\Functions\\Electrical\\coordinate_transformation.py\u001b[0m in \u001b[0;36mn2dq\u001b[1;34m(Z_n, theta, n)\u001b[0m\n\u001b[0;32m 155\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 156\u001b[0m \"\"\"\n\u001b[1;32m--> 157\u001b[1;33m \u001b[1;32mreturn\u001b[0m \u001b[0mab2dq\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mn2ab\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mZ_n\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mn\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mn\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mtheta\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 158\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 159\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n",
229-
"\u001b[1;32md:\\GitHub\\pyleecan\\pyleecan\\Functions\\Electrical\\coordinate_transformation.py\u001b[0m in \u001b[0;36mn2ab\u001b[1;34m(Z_n, n)\u001b[0m\n\u001b[0;32m 74\u001b[0m )\n\u001b[0;32m 75\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 76\u001b[1;33m \u001b[0mZ_ab\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mmatmul\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mZ_n\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mn_2_ab\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 77\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 78\u001b[0m \u001b[1;32mreturn\u001b[0m \u001b[0mZ_ab\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
230-
"\u001b[1;31mValueError\u001b[0m: matmul: Input operand 1 has a mismatch in its core dimension 0, with gufunc signature (n?,k),(k,m?)->(n?,m?) (size 3 is different from 16)"
231-
]
232-
}
233-
],
216+
"outputs": [],
234217
"source": [
235-
"_myResults = mySimu.run()"
218+
"myResults = mySimu.run()"
236219
]
237220
},
238221
{
@@ -243,7 +226,7 @@
243226
"![](https://www.pyleecan.org/_static/IPMSM_FEMM.png)\n",
244227
"The simulation will compute 16 different timesteps by updating the current and the sliding band boundary condition.\n",
245228
"\n",
246-
"Once the simulation is finished, an Output object is return. The results are stored in the magnetic part of the output (i.e. _myResults.mag_ ) and we can call different plots. This _myResults.mag_ contains: \n",
229+
"Once the simulation is finished, an Output object is return. The results are stored in the magnetic part of the output (i.e. _myResults.mag_ ) and different plots can be called. This _myResults.mag_ contains: \n",
247230
"- *time*: magnetic time vector without symmetry \n",
248231
"- *angle*: magnetic position vector without symmetry \n",
249232
"- *B*: airgap flux density (contains radial and tangential components) \n",
@@ -278,30 +261,41 @@
278261
"output_type": "display_data",
279262
"data": {
280263
"text/plain": "<IPython.core.display.HTML object>",
281-
"text/html": "<div id='48117cd5-41a3-4b0e-8b8e-40715d7d1306'></div>"
264+
"text/html": "<div id='7a622370-1512-42c4-9c6f-e8235c008a14'></div>"
282265
},
283266
"metadata": {}
284-
},
285-
{
286-
"output_type": "error",
287-
"ename": "AttributeError",
288-
"evalue": "'NoneType' object has no attribute 'name'",
289-
"traceback": [
290-
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
291-
"\u001b[1;31mAttributeError\u001b[0m Traceback (most recent call last)",
292-
"\u001b[1;32m<ipython-input-7-b1987da9c589>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[0mget_ipython\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mrun_line_magic\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m'matplotlib'\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m'notebook'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 2\u001b[1;33m \u001b[0mmyResults\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mplot_A_space\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"mag.B\"\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mt_index\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mis_fft\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;32mTrue\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mr_max\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;36m76\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
293-
"\u001b[1;32md:\\GitHub\\pyleecan\\pyleecan\\Methods\\Output\\Output\\plot\\plot_A_space.py\u001b[0m in \u001b[0;36mplot_A_space\u001b[1;34m(self, Data_str, index_list, t, t_index, is_deg, is_fft, is_spaceorder, r_max, fund_harm, is_norm, unit, data_list, component_list, legend_list, color_list, save_path, y_min, y_max, mag_max, is_auto_ticks, fig)\u001b[0m\n\u001b[0;32m 176\u001b[0m \u001b[0mmag_max\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mmag_max\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 177\u001b[0m \u001b[0mis_auto_ticks\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mis_auto_ticks\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 178\u001b[1;33m \u001b[0mfig\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mfig\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 179\u001b[0m )\n",
294-
"\u001b[1;32md:\\GitHub\\pyleecan\\pyleecan\\Functions\\Plot\\plot_A_space.py\u001b[0m in \u001b[0;36mplot_A_space\u001b[1;34m(data, index_list, t, t_index, is_deg, is_fft, is_spaceorder, r_max, fund_harm, is_norm, unit, data_list, legend_list, color_list, save_path, y_min, y_max, mag_max, is_auto_ticks, fig, subplot_index)\u001b[0m\n\u001b[0;32m 80\u001b[0m \u001b[0mdata_list2\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;33m[\u001b[0m\u001b[0mdata\u001b[0m\u001b[1;33m]\u001b[0m \u001b[1;33m+\u001b[0m \u001b[0mdata_list\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 81\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0mlegend_list\u001b[0m \u001b[1;33m==\u001b[0m \u001b[1;33m[\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 82\u001b[1;33m \u001b[0mlegend_list\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;33m[\u001b[0m\u001b[0md\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mname\u001b[0m \u001b[1;32mfor\u001b[0m \u001b[0md\u001b[0m \u001b[1;32min\u001b[0m \u001b[0mdata_list2\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 83\u001b[0m \u001b[0mcurve_colors\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mconfig_dict\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m\"PLOT\"\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m\"COLOR_DICT\"\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m\"CURVE_COLORS\"\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 84\u001b[0m \u001b[0mphase_colors\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mconfig_dict\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m\"PLOT\"\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m\"COLOR_DICT\"\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m\"PHASE_COLORS\"\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
295-
"\u001b[1;32md:\\GitHub\\pyleecan\\pyleecan\\Functions\\Plot\\plot_A_space.py\u001b[0m in \u001b[0;36m<listcomp>\u001b[1;34m(.0)\u001b[0m\n\u001b[0;32m 80\u001b[0m \u001b[0mdata_list2\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;33m[\u001b[0m\u001b[0mdata\u001b[0m\u001b[1;33m]\u001b[0m \u001b[1;33m+\u001b[0m \u001b[0mdata_list\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 81\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0mlegend_list\u001b[0m \u001b[1;33m==\u001b[0m \u001b[1;33m[\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 82\u001b[1;33m \u001b[0mlegend_list\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;33m[\u001b[0m\u001b[0md\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mname\u001b[0m \u001b[1;32mfor\u001b[0m \u001b[0md\u001b[0m \u001b[1;32min\u001b[0m \u001b[0mdata_list2\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 83\u001b[0m \u001b[0mcurve_colors\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mconfig_dict\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m\"PLOT\"\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m\"COLOR_DICT\"\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m\"CURVE_COLORS\"\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 84\u001b[0m \u001b[0mphase_colors\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mconfig_dict\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m\"PLOT\"\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m\"COLOR_DICT\"\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m\"PHASE_COLORS\"\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
296-
"\u001b[1;31mAttributeError\u001b[0m: 'NoneType' object has no attribute 'name'"
297-
]
298267
}
299268
],
300269
"source": [
301270
"%matplotlib notebook\n",
302271
"myResults.plot_A_space(\"mag.B\",t_index=1, is_fft=True, r_max=76)"
303272
]
304273
},
274+
{
275+
"cell_type": "markdown",
276+
"metadata": {},
277+
"source": [
278+
"If the mesh was saved in the output object (mySimu.mag.is_get_mesh = True), it can be plotted with:"
279+
]
280+
},
281+
{
282+
"cell_type": "code",
283+
"execution_count": 11,
284+
"metadata": {
285+
"tags": []
286+
},
287+
"outputs": [
288+
{
289+
"output_type": "stream",
290+
"name": "stderr",
291+
"text": "DEBUG:matplotlib.pyplot:Loaded backend nbAgg version unknown.\nWARNING:root:VTK requires 3D points, but 2D points given. Appending 0 third component.\n"
292+
}
293+
],
294+
"source": [
295+
"%matplotlib notebook\n",
296+
"myResults.mag.meshsolution.plot_contour(label=\"B\")"
297+
]
298+
},
305299
{
306300
"cell_type": "markdown",
307301
"metadata": {},
@@ -357,7 +351,7 @@
357351
"kernelspec": {
358352
"display_name": "Python 3.7.2 64-bit",
359353
"language": "python",
360-
"name": "python_defaultSpec_1597763043508"
354+
"name": "python_defaultSpec_1597849012176"
361355
},
362356
"language_info": {
363357
"codemirror_mode": {

0 commit comments

Comments
 (0)