diff --git a/Tests/Validation/Magnetics/test_SDM_SPMSM.py b/Tests/Validation/Magnetics/test_SDM_SPMSM.py new file mode 100644 index 000000000..c2f9ca07f --- /dev/null +++ b/Tests/Validation/Magnetics/test_SDM_SPMSM.py @@ -0,0 +1,61 @@ +import numpy as np +import matplotlib.pyplot as plt +import time + +import pytest + +from os.path import join + +from pyleecan.Classes.OPdq import OPdq + +from pyleecan.Classes.Simu1 import Simu1 +from pyleecan.Classes.InputCurrent import InputCurrent +from pyleecan.Classes.MagSDM import MagSDM +from pyleecan.Classes.SubdomainModel_SPMSM import SubdomainModel_SPMSM + +from pyleecan.Functions.load import load +from pyleecan.definitions import DATA_DIR + +from SciDataTool.Functions.Plot.plot_3D import plot_3D + + +# @pytest.mark.long_5s +@pytest.mark.MagSDM +@pytest.mark.periodicity +@pytest.mark.SIPMSM +@pytest.mark.SingleOP +def test_SDM_SPMSM_single_OP(is_periodicity_a=True): + """Test to compute the Flux in SDM for the SPMSM 12s8p in""" + + SPMSM_001 = load(join(DATA_DIR, "Machine", "SPMSM_001.json")) + simu = Simu1(name="test_SDM_SPMSM_single_OP", machine=SPMSM_001) + + simu.input = InputCurrent( + OP=OPdq(N0=1200, Id_ref=0, Iq_ref=0), + Ir=None, + Na_tot=1024, + Nt_tot=8 * 200, + is_periodicity_a=is_periodicity_a, + is_periodicity_t=True, + ) + + simu.mag = MagSDM( + type_BH_stator=0, + type_BH_rotor=0, + is_periodicity_a=is_periodicity_a, + is_periodicity_t=True, + subdomain_model=SubdomainModel_SPMSM(), + Nharm_coeff=2, + is_mmfr=True, + ) + + out = simu.run() + + out.mag.B.plot_2D_Data("angle", "time[0]") + out.mag.Tem.plot_2D_Data("time") + + return out + + +if __name__ == "__main__": + out = test_SDM_SPMSM_single_OP() diff --git a/Tests/Validation/Magnetics/test_SDM_slot.py b/Tests/Validation/Magnetics/test_SDM_slot.py new file mode 100644 index 000000000..f6f62e192 --- /dev/null +++ b/Tests/Validation/Magnetics/test_SDM_slot.py @@ -0,0 +1,256 @@ +import numpy as np +import matplotlib.pyplot as plt +import time + +from SciDataTool.Functions.Plot.plot_3D import plot_3D + +t0 = time.time() + +# % SDM validation step 1.1 : +# % Paper Lubin 2010b and Lubin_2011b +# % Machine with no load rotor, rotor slots, current sheet on stator side + +# %% VALIDATION CASES +# % 0 = Lubin_2010a fig.6 +# % 1 = Lubin_2010a fig.11 +# % 2 = Lubin_2010a fig.12 +# % 3 = Lubin_2011b fig.5 +validation_case = 3 + + +# %% PROBLEM PARAMETERS + +mu_0 = np.pi * 4e-7 + +R_1 = 0.04 +R_2 = 0.07 +R_3 = 0.08 +L = 0.1 + +theta_i0 = 135 * np.pi / 180 + +N = 50 +K = 50 + +K_1 = 1e5 + +if validation_case == 0: + Z_r = 1 + p = 1 + alpha = 0 + beta = 0.78 + m = 1 + + +if validation_case == 1: + Z_r = 4 + p = 2 + N = 50 + K = 50 + K_1 = 1e5 + theta_i0 = 135 * np.pi / 180 + alpha = np.pi / 4 + beta = 0.78 + m = 1 + + +if validation_case == 2: + Z_r = 4 + p = 2 + N = 50 + K = 50 + K_1 = 1e5 + theta_i0 = 135 * np.pi / 180 + alpha = 0 + + m = 1 + + +if validation_case == 3: + Z_r = 18 + p = 2 + N = 200 + K = 20 + K_1 = 8e4 + theta_i0 = 140 * np.pi / 180 + alpha = np.pi / 2 + beta = 0.6 * 3.14 / Z_r + m = 1 + R_1 = 0.04 + R_2 = 0.06 + R_3 = 0.063 + L = 0.5 + + +# %% AIRGAP FLUX COMPUTATION + +i = np.arange(0, Z_r) + 1 +k = np.arange(0, K) + 1 +n = np.arange(0, N) + 1 + +kni, nik, ikn = np.meshgrid(k, n, i) + +kni = np.reshape(kni, (N, K * Z_r)) +nik = np.reshape(nik, (N, K * Z_r)) +ikn = np.reshape(ikn, (N, K * Z_r)) + +theta_rot = np.linspace(0, 2 * np.pi, 100) + +Csts = np.zeros((100, 4 * N + K * Z_r)) + +for ii, a0 in enumerate(theta_rot): + theta_i = 2 * np.pi / Z_r * (i - 1) + theta_i0 + a0 + theta_ikn = 2 * np.pi / Z_r * (ikn - 1) + theta_i0 * np.ones(ikn.shape) + a0 + + I_coskcosni = ( + beta**2 + * nik + * ( + (-1) ** kni * np.sin(nik * (beta + 2 * theta_ikn) / 2) + + np.sin(nik * (beta - 2 * theta_ikn) / 2) + ) + / (beta**2 * nik**2 - np.pi**2 * kni**2) + ) + I_cosksinni = ( + beta**2 + * nik + * ( + -((-1) ** kni) * np.cos(nik * (beta + 2 * theta_ikn) / 2) + + np.cos(nik * (beta - 2 * theta_ikn) / 2) + ) + / (beta**2 * nik**2 - np.pi**2 * kni**2) + ) + + P_nik_R2_R3 = (R_3 / R_2) ** nik + (R_2 / R_3) ** nik + E_nik_R2_R3 = -((R_3 / R_2) ** nik) + (R_2 / R_3) ** nik + E_kni_R1_R2 = -((R_2 / R_1) ** (np.pi * kni / beta)) + (R_1 / R_2) ** ( + np.pi * kni / beta + ) + P_kni_R1_R2 = (R_2 / R_1) ** (np.pi * kni / beta) + (R_1 / R_2) ** ( + np.pi * kni / beta + ) + + Jm_cos = np.zeros(N) + Jm_cos[m * p - 1] = mu_0 * K_1 * np.cos(m * p * (alpha + a0)) + + Jm_sin = np.zeros(N) + Jm_sin[m * p - 1] = mu_0 * K_1 * np.sin(m * p * (alpha + a0)) + + M15 = 1 / (R_2 * beta) * I_coskcosni * kni * E_kni_R1_R2 / P_kni_R1_R2 + + M35 = 1 / (R_2 * beta) * I_cosksinni * kni * E_kni_R1_R2 / P_kni_R1_R2 + + M51 = -2 * R_2 / beta * I_coskcosni * P_nik_R2_R3 / (nik * E_nik_R2_R3) + M52 = 4 * R_3 / beta * I_coskcosni / (nik * E_nik_R2_R3) + M53 = -2 * R_2 / beta * I_cosksinni * P_nik_R2_R3 / (nik * E_nik_R2_R3) + M54 = 4 * R_3 / beta * I_cosksinni / (nik * E_nik_R2_R3) + + L1 = np.concatenate( + (np.eye(N), np.zeros((N, N)), np.zeros((N, N)), np.zeros((N, N)), M15), axis=1 + ) + + L2 = np.concatenate( + ( + np.zeros((N, N)), + np.eye(N), + np.zeros((N, N)), + np.zeros((N, N)), + np.zeros((N, Z_r * K)), + ), + axis=1, + ) + + L3 = np.concatenate( + (np.zeros((N, N)), np.zeros((N, N)), np.eye(N), np.zeros((N, N)), M35), axis=1 + ) + + L4 = np.concatenate( + ( + np.zeros((N, N)), + np.zeros((N, N)), + np.zeros((N, N)), + np.eye(N), + np.zeros((N, Z_r * K)), + ), + axis=1, + ) + + L5 = np.concatenate((M51.T, M52.T, M53.T, M54.T, np.eye(Z_r * K)), axis=1) + + Mat = np.concatenate((L1, L2, L3, L4, L5), axis=0) + + Vect = np.concatenate((np.zeros(N), Jm_cos, np.zeros(N), Jm_sin, np.zeros(Z_r * K))) + + Csts[ii, :] = np.linalg.solve(Mat, Vect) + +A_In = Csts[:, :N] +B_In = Csts[:, N : 2 * N] +C_In = Csts[:, 2 * N : 3 * N] +D_In = Csts[:, 3 * N : 4 * N] + +theta = np.arange(0, 360) * np.pi / 180 + +thetan, ntheta = np.meshgrid(theta, n) + +r = (R_2 + R_3) / 2 +# % r = R_2 +n = n[None, :] +P_n_r_R3 = (r / R_3) ** n + (R_3 / r) ** n +P_n_r_R2 = (r / R_2) ** n + (R_2 / r) ** n +E_n_r_R3 = (r / R_3) ** n - (R_3 / r) ** n +E_n_r_R2 = (r / R_2) ** n - (R_2 / r) ** n +E_n_R2_R3 = -((R_3 / R_2) ** n) + (R_2 / R_3) ** n + + +cosn = np.cos(ntheta * thetan) +sinn = np.sin(ntheta * thetan) + +Bthetag_cos = -( + R_2 / r * A_In * E_n_r_R3 / E_n_R2_R3 - R_3 / r * B_In * E_n_r_R2 / E_n_R2_R3 +) +Bthetag_sin = -( + R_2 / r * C_In * E_n_r_R3 / E_n_R2_R3 - R_3 / r * D_In * E_n_r_R2 / E_n_R2_R3 +) +Bthetag = np.matmul(Bthetag_cos, cosn) + np.matmul(Bthetag_sin, sinn) + +Brg_sin = -( + R_2 / r * A_In * P_n_r_R3 / E_n_R2_R3 - R_3 / r * B_In * P_n_r_R2 / E_n_R2_R3 +) +Brg_cos = R_2 / r * C_In * P_n_r_R3 / E_n_R2_R3 - R_3 / r * D_In * P_n_r_R2 / E_n_R2_R3 +Brg = np.matmul(Brg_cos, cosn) + np.matmul(Brg_sin, sinn) + +print("Elapsed time: " + str(time.time() - t0)) + +# %% PLOT + +plt.figure() +plt.plot(theta, Brg[0, :], "k") +plt.plot(theta, Bthetag[0, :], "r") +plt.show() +# plt.figure() +# plt.plot(n[0], Brg_cos[0, :], "k") +# plt.plot(n[0], Brg_sin[0, :], "r") + +# plt.show() + +plot_3D( + theta_rot, + theta, + Brg, + type_plot="pcolor", + y_min=0, + y_max=theta.max(), + x_min=0, + x_max=theta_rot.max(), +) + +pass + +# subplot(2,2,2) +# bar(Brg_cos) +# hold on +# bar(Brg_sin, 'r') +# subplot(2,2,4) +# bar(Bthetag_cos) +# hold on +# bar(Bthetag_sin, 'r') diff --git a/Tutorials/tuto_subdomain_model.ipynb b/Tutorials/tuto_subdomain_model.ipynb new file mode 100644 index 000000000..7e8c63c60 --- /dev/null +++ b/Tutorials/tuto_subdomain_model.ipynb @@ -0,0 +1,261 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 12, + "id": "6d9e105b", + "metadata": {}, + "outputs": [], + "source": [ + "from sympy import symbols, init_printing, Function, Sum, Eq, Matrix,cos, sin, pi, I, exp\n", + "\n", + "#Paper T.Lubin 2010b\n", + "#Machine with no load rotor, rotor slots, current sheet on stator side\n", + "\n", + "init_printing()\n", + "\n", + "R_1, R_2, R_3, beta, mu_0 = symbols('R_1, R_2, R_3, beta, mu_0', real = 'true', positive = 'true', nonzero ='true')\n", + "\n", + "theta_i = symbols('theta_i')\n", + " \n", + "#Declaration of the motor geometry\n", + "Z_r = symbols('Z_r', integer = 'true', positive = 'true', nonzero ='true') #Number of rotor, stator slots\n", + "\n", + "#Declaration of the space variables\n", + "r, t = symbols('r t', real = 'true', positive = 'true')\n", + "theta = symbols('theta', real ='true')\n", + "\n", + "#Declaration of the discretizing integers for stator and rotor slots\n", + "i = symbols('i', integer='true', positive = 'true', nonzero='true')\n", + "\n", + "#Declaration of th magnetic potentials in the 5 areas\n", + "P = Function(\"P\")\n", + "E = Function(\"E\")" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "id": "dbb5cee1", + "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "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\n", + "text/latex": [ + "$\\displaystyle \\operatorname{Az_{I}}{\\left(r,\\theta,t \\right)} = A_{I0} + \\sum_{\\substack{1 \\leq n \\leq N\\\\1 \\leq k \\leq K}} e^{i \\left(k t + n \\theta\\right)} \\left(\\frac{R_{2} P{\\left(n,r,R_{3} \\right)} A_{In}}{n E{\\left(n,R_{2},R_{3} \\right)}} - \\frac{R_{3} P{\\left(n,r,R_{2} \\right)} B_{In}}{n E{\\left(n,R_{2},R_{3} \\right)}}\\right)$" + ], + "text/plain": [ + " K N \n", + " ____ ____ \n", + " ╲ ╲ \n", + " ╲ ╲ \n", + " ╲ ╲ ⅈ⋅(k⋅t + n⋅θ) ⎛R₂⋅P(n, r, R₃)⋅A_In R₃⋅P(\n", + "Az_I(r, θ, t) = A_I0 + ╱ ╱ ℯ ⋅⎜─────────────────── - ─────\n", + " ╱ ╱ ⎝ n⋅E(n, R₂, R₃) n⋅\n", + " ╱ ╱ \n", + " ‾‾‾‾ ‾‾‾‾ \n", + " k = 1 n = 1 \n", + "\n", + " \n", + " \n", + " \n", + " \n", + "n, r, R₂)⋅B_In⎞\n", + "──────────────⎟\n", + "E(n, R₂, R₃) ⎠\n", + " \n", + " \n", + " " + ] + }, + "execution_count": 13, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "##AREA I : AIR GAP\n", + "#Dummy variable(s) of summation \n", + "n, N, k, K = symbols('n N k K', integer = 'true', positive = 'true', nonzero ='true')\n", + "#Integration constants\n", + "A_I0, A_In, B_In, C_In, D_In = symbols('A_I0, A_In, B_In, C_In, D_In', commutative=False)\n", + "#Expression of the potential\n", + "AzI_cst = A_I0\n", + "AzI_exp = A_In*R_2/n*P(n, r, R_3)/E(n, R_2, R_3) - B_In*R_3/n*P(n, r, R_2)/E(n, R_2, R_3)\n", + "expn = exp(I*(n*theta + k*t))\n", + "AzI = AzI_cst + Sum(Sum(AzI_exp*expn,(n,1,N)), (k,1,K))\n", + "\n", + "#Expression of the field\n", + "#BrI_cst, BrI_cos, BrI_sin = compute_Br(AzI_cst, AzI_cos, AzI_sin, n, r, theta)\n", + "#BrI = BrI_cst + Sum(BrI_cos*cosn+BrI_sin*sinn,(n,1,N))\n", + "\n", + "#BthetaI_cst, BthetaI_cos, BthetaI_sin = compute_Btheta(AzI_cst, AzI_cos, AzI_sin, r)\n", + "#BthetaI = BthetaI_cst + Sum(BthetaI_cos*cosn+BthetaI_sin*sinn,(n,1,N))\n", + "\n", + "fAzI = Function('Az_I')(r,theta,t)\n", + "fBrI = Function('Br_I')(r,theta,t)\n", + "fBthetaI = Function('Btheta_I')(r,theta)\n", + "\n", + "\n", + "Eq(fAzI, AzI) #, Eq(fBrI, BrI), Eq(fBthetaI, BthetaI)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "b20a1de9", + "metadata": {}, + "outputs": [], + "source": [ + "##AREA i : ROTOR SLOT\n", + "#Dummy variable(s) of summation \n", + "k, K = symbols('k, K', integer = 'true', nonzero = 'true')\n", + "#Integration constants\n", + "A_i0, A_ik = symbols('A_i0, A_ik', commutative=False)\n", + "#Expression of the potential\n", + "Azi_cst = A_i0 \n", + "Azi_cos = A_ik*P(k*pi/beta, R_1, r)/P(k*pi/beta, R_1, R_2)\n", + "Azi_sin = 0\n", + "coski = cos(k*pi/beta*(theta-theta_i+beta/2))\n", + "sinki = sin(k*pi/beta*(theta-theta_i+beta/2))\n", + "Azi = Azi_cst + Sum(Azi_cos*coski,(k,1,K))\n", + "\n", + "#Expression of the field\n", + "Bri_cst, Bri_cos, Bri_sin = compute_Br(Azi_cst, Azi_cos, Azi_sin, k*pi/beta, r, theta)\n", + "Bri = Bri_cst + Sum(Bri_cos*coski+Bri_sin*sinki,(k,1,K))\n", + "\n", + "Bthetai_cst, Bthetai_cos, Bthetai_sin = compute_Btheta(Azi_cst, Azi_cos, Azi_sin, r)\n", + "Bthetai = Bthetai_cst + Sum(Bthetai_cos*coski+Bthetai_sin*sinki,(k,1,K))\n", + "\n", + "fAzi = Function('Az_i')(r,theta)\n", + "fBri = Function('Br_i')(r,theta)\n", + "fBthetai = Function('Btheta_i')(r,theta)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "547a5dd9", + "metadata": {}, + "outputs": [], + "source": [ + "Potentials = Matrix([Eq(fAzI, AzI), Eq(fAzi, Azi)])\n", + "Fields = Matrix([Eq(fBrI, BrI), Eq(fBthetaI, BthetaI), Eq(fBri, Bri), Eq(fBthetai, Bthetai)])\n", + "\n", + "#Current sheet \n", + "p, m, M = symbols('p, m, M', integer = 'true', nonzero = 'true')\n", + "fK = Function('K')(theta)\n", + "K_m, alpha = symbols('K_m, alpha')\n", + "K_cos = K_m\n", + "cosm = cos(m*p(theta-alpha))\n", + "K = Sum(K_cos*cosm, (m,1,M))\n", + "\n", + "## RESULTING EQUATIONS \n", + "\n", + "Csts = Matrix([A_In, B_In, C_In, D_In, A_ik])\n", + "var = [n, n, n, n, (k, i)]\n", + "\n", + "##General integrals to compute\n", + "fI_cosni, fI_sinni = symbols('I_cosni, I_sinni', commutative = False)\n", + "fI_cosksinni, fI_coskcosni = symbols('I_cosksinni, I_coskcosni', commutative = False) \n", + "\n", + "##CONDITION A.11 = A.9 \n", + "A_11 = Eq(BthetaI_cos.subs(r, R_2), 1/pi*(Bthetai_cst.subs(r, R_2)*fI_cosni +Bthetai_cos.subs(r, R_2)*fI_coskcosni))\n", + "\n", + "##CONDITION A.7\n", + "A_7 = Eq(B_In, mu_0*K_m*cos(m*p*alpha))\n", + "\n", + "##CONDITION A.12 = A.10 \n", + "A_12 = Eq(BthetaI_sin.subs(r, R_2), 1/pi*(Bthetai_cst.subs(r, R_2)*fI_sinni +Bthetai_cos.subs(r, R_2)*fI_cosksinni))\n", + "\n", + "##CONDITION A.8\n", + "A_8 = Eq(D_In, mu_0*K_m*sin(m*p*alpha))\n", + "\n", + "##CONDITION A.13\n", + "A_13 = Eq(A_ik, 2/beta*((A_In*R_2/n*P(n, R_2, R_3)/E(n, R_2, R_3) + B_In*R_3/n*2/E(n, R_3, R_2))*fI_coskcosni + (C_In*R_2/n*P(n, R_2, R_3)/E(n, R_2, R_3) + D_In*R_3/n*2/E(n, R_3, R_2))*fI_cosksinni))\n", + "A_13bis = Eq(Azi_cos.subs(r, R_2), 2/beta*(AzI_cos.subs(r, R_2)*fI_coskcosni + AzI_sin.subs(r, R_2)*fI_cosksinni))\n", + "\n", + "SetEqs = Matrix([A_11, A_7, A_12, A_8, A_13])\n", + "\n", + "Mat, Vect, Index = get_System(var, var, Csts, SetEqs)\n", + "\n", + "#I_coskcosni = computeInt_coscos(k*pi/beta, -theta_i + beta/2, n, 0, theta_i - beta/2, theta_i + beta/2)\n", + "#I_cosksinni = computeInt_cossin(k*pi/beta, -theta_i + beta/2, n, 0, theta_i - beta/2, theta_i + beta/2)\n", + "\n", + "#I_coskcosni = computeInt_coscos(k*pi/beta, -theta_i, n, 0, theta_i, theta_i + beta)\n", + "#I_cosksinni = computeInt_cossin(k*pi/beta, -theta_i, n, 0, theta_i, theta_i + beta)\n", + "\n", + "#def P(n,x,y) :\n", + "# \n", + "# return (x/y)**n + (y/x)**n\n", + "#\n", + "#def E(n,x,y) :\n", + "#\n", + "# return (x/y)**n - (y/x)**n\n", + "#\n", + "#P_n_R2_R3 = P(n, R_2, R_3)\n", + "#E_n_R2_R3 = E(n, R_2, R_3)\n", + "#E_n_R3_R2 = E(n, R_3, R_2)\n", + "#E_k_R1_R2 = E(k*pi/beta, R_1, R_2)\n", + "#P_k_R1_R2 = P(k*pi/beta, R_1, R_2)\n", + "\n", + "#Current sheet Fourier series expansion\n", + "#I1 = computeInt_coscos(m*p, -alpha, n, 0, 0,2*pi)\n", + "#I2 = computeInt_coscos(m*p, -alpha, m*p, 0, 0,2*pi)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.8" + }, + "latex_envs": { + "LaTeX_envs_menu_present": true, + "autoclose": false, + "autocomplete": true, + "bibliofile": "biblio.bib", + "cite_by": "apalike", + "current_citInitial": 1, + "eqLabelWithNumbers": true, + "eqNumInitial": 1, + "hotkeys": { + "equation": "Ctrl-E", + "itemize": "Ctrl-I" + }, + "labels_anchors": false, + "latex_user_defs": false, + "report_style_numbering": false, + "user_envs_cfg": false + }, + "toc": { + "base_numbering": 1, + "nav_menu": {}, + "number_sections": true, + "sideBar": true, + "skip_h1_title": false, + "title_cell": "Table of Contents", + "title_sidebar": "Contents", + "toc_cell": false, + "toc_position": {}, + "toc_section_display": true, + "toc_window_display": false + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/pyleecan/Classes/Class_Dict.json b/pyleecan/Classes/Class_Dict.json index 0e45e15d2..555b37d57 100644 --- a/pyleecan/Classes/Class_Dict.json +++ b/pyleecan/Classes/Class_Dict.json @@ -68,6 +68,7 @@ "max": "", "min": "", "name": "begin", + "size": "0", "type": "complex", "unit": "", "value": 0 @@ -78,6 +79,7 @@ "max": "", "min": "", "name": "end", + "size": "0", "type": "complex", "unit": "", "value": 0 @@ -88,6 +90,7 @@ "max": "", "min": "", "name": "radius", + "size": "m", "type": "float", "unit": "", "value": 0 @@ -98,6 +101,7 @@ "max": "", "min": "", "name": "is_trigo_direction", + "size": "0", "type": "bool", "unit": "-", "value": 1 @@ -142,6 +146,7 @@ "max": "", "min": "", "name": "begin", + "size": "0", "type": "complex", "unit": "-", "value": 0 @@ -152,6 +157,7 @@ "max": "", "min": "", "name": "center", + "size": "0", "type": "complex", "unit": "-", "value": 0 @@ -162,6 +168,7 @@ "max": "6.283185308", "min": "-6.283185308", "name": "angle", + "size": "0", "type": "float", "unit": "rad", "value": 1.57079633 @@ -206,6 +213,7 @@ "max": "", "min": "", "name": "begin", + "size": "0", "type": "complex", "unit": "-", "value": 0 @@ -216,6 +224,7 @@ "max": "", "min": "", "name": "end", + "size": "0", "type": "complex", "unit": "-", "value": 0 @@ -226,6 +235,7 @@ "max": "", "min": "", "name": "is_trigo_direction", + "size": "0", "type": "bool", "unit": "-", "value": 1 @@ -270,6 +280,7 @@ "max": "2", "min": "0", "name": "type_merge_slot", + "size": "", "type": "int", "unit": "", "value": 1 @@ -280,6 +291,7 @@ "max": "", "min": "", "name": "alpha", + "size": "", "type": "float", "unit": "rad", "value": 0 @@ -312,6 +324,7 @@ "max": "", "min": "0", "name": "N", + "size": "", "type": "int", "unit": "-", "value": 8 @@ -322,6 +335,7 @@ "max": "", "min": "0", "name": "Rarc", + "size": "", "type": "float", "unit": "m", "value": 0.01 @@ -353,6 +367,7 @@ "max": "", "min": "0", "name": "N", + "size": "", "type": "int", "unit": "-", "value": 8 @@ -363,6 +378,7 @@ "max": "", "min": "0", "name": "Rarc", + "size": "", "type": "float", "unit": "m", "value": 0.0375 @@ -373,6 +389,7 @@ "max": "", "min": "", "name": "W1", + "size": "", "type": "float", "unit": "m", "value": 0.0035 @@ -406,6 +423,7 @@ "max": "", "min": "0", "name": "N", + "size": "", "type": "int", "unit": "-", "value": 8 @@ -416,6 +434,7 @@ "max": "", "min": "0", "name": "k", + "size": "", "type": "float", "unit": "-", "value": 1 @@ -426,6 +445,7 @@ "max": "", "min": "0", "name": "delta_d", + "size": "", "type": "float", "unit": "m", "value": 0.001 @@ -436,6 +456,7 @@ "max": "", "min": "0", "name": "delta_q", + "size": "", "type": "float", "unit": "m", "value": null @@ -446,6 +467,7 @@ "max": "", "min": "0", "name": "W0", + "size": "", "type": "float", "unit": "m", "value": null @@ -477,6 +499,7 @@ "max": "", "min": "", "name": "line_list", + "size": "", "type": "[Line]", "unit": "-", "value": "" @@ -487,6 +510,7 @@ "max": "", "min": "1", "name": "sym", + "size": "", "type": "int", "unit": "-", "value": 1 @@ -497,6 +521,7 @@ "max": "", "min": "", "name": "name", + "size": "", "type": "str", "unit": "-", "value": "" @@ -530,6 +555,7 @@ "max": "", "min": "", "name": "connectivity", + "size": "", "type": "ndarray", "unit": "", "value": "" @@ -540,6 +566,7 @@ "max": "", "min": "", "name": "nb_cell", + "size": "", "type": "int", "unit": "", "value": 0 @@ -550,6 +577,7 @@ "max": "", "min": "", "name": "nb_node_per_cell", + "size": "", "type": "int", "unit": "", "value": 0 @@ -560,6 +588,7 @@ "max": "", "min": "", "name": "indice", + "size": "", "type": "ndarray", "unit": "", "value": "" @@ -570,6 +599,7 @@ "max": "", "min": "", "name": "interpolation", + "size": "", "type": "Interpolation", "unit": "", "value": "" @@ -608,6 +638,7 @@ "max": "", "min": "0", "name": "radius", + "size": "", "type": "float", "unit": "", "value": 1 @@ -618,6 +649,7 @@ "max": "", "min": "", "name": "center", + "size": "", "type": "complex", "unit": "", "value": 0 @@ -628,6 +660,7 @@ "max": "", "min": "", "name": "prop_dict", + "size": "", "type": "dict", "unit": "", "value": "" @@ -668,6 +701,7 @@ "max": "", "min": "0", "name": "Hwire", + "size": "0", "type": "float", "unit": "m", "value": 0.01 @@ -678,6 +712,7 @@ "max": "", "min": "0", "name": "Wwire", + "size": "0", "type": "float", "unit": "m", "value": 0.01 @@ -688,6 +723,7 @@ "max": "", "min": "1", "name": "Nwppc_rad", + "size": "0", "type": "int", "unit": "-", "value": 1 @@ -698,6 +734,7 @@ "max": "", "min": "1", "name": "Nwppc_tan", + "size": "0", "type": "int", "unit": "-", "value": 1 @@ -708,6 +745,7 @@ "max": "", "min": "0", "name": "Wins_wire", + "size": "0", "type": "float", "unit": "m", "value": 0 @@ -718,6 +756,7 @@ "max": "", "min": "0", "name": "Wins_coil", + "size": "0", "type": "float", "unit": "m", "value": 0 @@ -728,6 +767,7 @@ "max": "1", "min": "0", "name": "type_winding_shape", + "size": "0", "type": "int", "unit": "-", "value": 0 @@ -738,6 +778,7 @@ "max": "180", "min": "0", "name": "alpha_ew", + "size": "0", "type": "float", "unit": "deg", "value": 58 @@ -779,6 +820,7 @@ "max": "", "min": "0", "name": "Wwire", + "size": "0", "type": "float", "unit": "m", "value": 0.015 @@ -789,6 +831,7 @@ "max": "", "min": "0", "name": "Wins_cond", + "size": "0", "type": "float", "unit": "m", "value": 0.015 @@ -799,6 +842,7 @@ "max": "", "min": "1", "name": "Nwppc", + "size": "0", "type": "int", "unit": "-", "value": 1 @@ -809,6 +853,7 @@ "max": "", "min": "0", "name": "Wins_wire", + "size": "0", "type": "float", "unit": "m", "value": 0 @@ -819,6 +864,7 @@ "max": "", "min": "0", "name": "Kwoh", + "size": "0", "type": "float", "unit": "-", "value": 0.5 @@ -859,6 +905,7 @@ "max": "", "min": "0", "name": "Wwire", + "size": "0", "type": "float", "unit": "m", "value": 0.015 @@ -869,6 +916,7 @@ "max": "", "min": "0", "name": "Wins_cond", + "size": "0", "type": "float", "unit": "m", "value": 0.015 @@ -879,6 +927,7 @@ "max": "", "min": "1", "name": "Nwppc_rad", + "size": "0", "type": "int", "unit": "-", "value": 1 @@ -889,6 +938,7 @@ "max": "", "min": "1", "name": "Nwppc_tan", + "size": "0", "type": "int", "unit": "-", "value": 1 @@ -899,6 +949,7 @@ "max": "", "min": "0", "name": "Wins_wire", + "size": "0", "type": "float", "unit": "m", "value": 0 @@ -909,6 +960,7 @@ "max": "", "min": "0", "name": "Kwoh", + "size": "0", "type": "float", "unit": "-", "value": 0.5 @@ -948,6 +1000,7 @@ "max": "", "min": "0", "name": "Hbar", + "size": "0", "type": "float", "unit": "m", "value": 0.01 @@ -958,6 +1011,7 @@ "max": "", "min": "0", "name": "Wbar", + "size": "0", "type": "float", "unit": "m", "value": 0.01 @@ -968,6 +1022,7 @@ "max": "", "min": "0", "name": "Wins", + "size": "0", "type": "float", "unit": "m", "value": 0 @@ -1004,6 +1059,7 @@ "max": "", "min": "0", "name": "Sbar", + "size": "0", "type": "float", "unit": "m", "value": 0.01 @@ -1043,6 +1099,7 @@ "max": "", "min": "", "name": "cond_mat", + "size": "0", "type": "Material", "unit": "-", "value": "" @@ -1053,6 +1110,7 @@ "max": "", "min": "", "name": "ins_mat", + "size": "0", "type": "Material", "unit": "-", "value": "" @@ -1083,6 +1141,7 @@ "max": "", "min": "", "name": "file_path", + "size": "", "type": "str", "unit": "-", "value": "" @@ -1093,6 +1152,7 @@ "max": "", "min": "", "name": "surf_dict", + "size": "", "type": "dict", "unit": "-", "value": "" @@ -1103,6 +1163,7 @@ "max": "", "min": "", "name": "BC_list", + "size": "", "type": "list", "unit": "-", "value": [] @@ -1136,6 +1197,7 @@ "max": "", "min": "", "name": "name", + "size": "0", "type": "str", "unit": "-", "value": "" @@ -1146,6 +1208,7 @@ "max": "", "min": "", "name": "symbol", + "size": "", "type": "str", "unit": "-", "value": "" @@ -1156,6 +1219,7 @@ "max": "", "min": "", "name": "unit", + "size": "", "type": "str", "unit": "-", "value": "" @@ -1166,6 +1230,7 @@ "max": "", "min": "", "name": "keeper", + "size": "", "type": "function", "unit": "-", "value": null @@ -1176,6 +1241,7 @@ "max": "", "min": "", "name": "error_keeper", + "size": "", "type": "function", "unit": "-", "value": null @@ -1186,6 +1252,7 @@ "max": "", "min": "", "name": "result", + "size": "", "type": "[]", "unit": "-", "value": "" @@ -1196,6 +1263,7 @@ "max": "", "min": "", "name": "result_ref", + "size": "", "type": "", "unit": "-", "value": null @@ -1206,6 +1274,7 @@ "max": "", "min": "", "name": "physic", + "size": "", "type": "str", "unit": "-", "value": "None" @@ -1236,6 +1305,7 @@ "max": "", "min": "0", "name": "Umax", + "size": "", "type": "float", "unit": "V", "value": 800 @@ -1246,6 +1316,7 @@ "max": "", "min": "0", "name": "Imax", + "size": "", "type": "float", "unit": "A", "value": 800 @@ -1256,6 +1327,7 @@ "max": "", "min": "", "name": "is_current", + "size": "", "type": "bool", "unit": "-", "value": 0 @@ -1286,6 +1358,7 @@ "max": "", "min": "", "name": "wave", + "size": "", "type": "Import", "unit": "", "value": "" @@ -1328,6 +1401,7 @@ "max": "", "min": "", "name": "type_skin_effect", + "size": "1", "type": "int", "unit": "-", "value": 1 @@ -1338,6 +1412,7 @@ "max": "", "min": "", "name": "OP", + "size": "", "type": "OP", "unit": "-", "value": null @@ -1348,6 +1423,7 @@ "max": "", "min": "", "name": "Tsta", + "size": "0", "type": "float", "unit": "deg Celsius", "value": 20 @@ -1358,6 +1434,7 @@ "max": "", "min": "", "name": "Trot", + "size": "0", "type": "float", "unit": "deg Celsius", "value": 20 @@ -1368,6 +1445,7 @@ "max": "", "min": "", "name": "Xkr_skinS", + "size": "", "type": "float", "unit": "", "value": 1 @@ -1378,6 +1456,7 @@ "max": "", "min": "", "name": "Xke_skinS", + "size": "", "type": "float", "unit": "", "value": 1 @@ -1388,6 +1467,7 @@ "max": "", "min": "", "name": "Xkr_skinR", + "size": "", "type": "float", "unit": "", "value": 1 @@ -1398,6 +1478,7 @@ "max": "", "min": "", "name": "Xke_skinR", + "size": "", "type": "float", "unit": "", "value": 1 @@ -1408,6 +1489,7 @@ "max": "", "min": "", "name": "R1", + "size": "", "type": "float", "unit": "Ohm", "value": null @@ -1418,6 +1500,7 @@ "max": "", "min": "", "name": "fluxlink", + "size": "", "type": "Magnetics", "unit": "-", "value": null @@ -1480,6 +1563,7 @@ "max": "", "min": "", "name": "Ld", + "size": "", "type": "float", "unit": "H", "value": null @@ -1490,6 +1574,7 @@ "max": "", "min": "", "name": "Lq", + "size": "", "type": "float", "unit": "H", "value": null @@ -1500,6 +1585,7 @@ "max": "", "min": "", "name": "Phid", + "size": "", "type": "float", "unit": "Wb", "value": null @@ -1510,6 +1596,7 @@ "max": "", "min": "", "name": "Phiq", + "size": "", "type": "float", "unit": "Wb", "value": null @@ -1520,6 +1607,7 @@ "max": "", "min": "", "name": "Phid_mag", + "size": "", "type": "float", "unit": "Wb", "value": null @@ -1530,6 +1618,7 @@ "max": "", "min": "", "name": "Phiq_mag", + "size": "", "type": "float", "unit": "Wb", "value": null @@ -1572,6 +1661,7 @@ "max": "", "min": "", "name": "Rfe", + "size": "", "type": "float", "unit": "Ohm", "value": null @@ -1582,6 +1672,7 @@ "max": "", "min": "", "name": "L1", + "size": "", "type": "float", "unit": "H", "value": null @@ -1592,6 +1683,7 @@ "max": "", "min": "", "name": "R2", + "size": "", "type": "float", "unit": "Ohm", "value": null @@ -1602,6 +1694,7 @@ "max": "", "min": "", "name": "L2", + "size": "", "type": "float", "unit": "H", "value": null @@ -1612,6 +1705,7 @@ "max": "", "min": "", "name": "K21Z", + "size": "", "type": "float", "unit": "", "value": null @@ -1622,6 +1716,7 @@ "max": "", "min": "", "name": "K21I", + "size": "", "type": "float", "unit": "", "value": null @@ -1632,6 +1727,7 @@ "max": "", "min": "", "name": "Im_table", + "size": "", "type": "ndarray", "unit": "Arms", "value": null @@ -1642,6 +1738,7 @@ "max": "", "min": "", "name": "Lm_table", + "size": "", "type": "ndarray", "unit": "H", "value": null @@ -1652,6 +1749,7 @@ "max": "", "min": "", "name": "I1", + "size": "", "type": "complex", "unit": "Arms", "value": null @@ -1662,6 +1760,7 @@ "max": "", "min": "", "name": "I2", + "size": "", "type": "complex", "unit": "Arms", "value": null @@ -1672,6 +1771,7 @@ "max": "", "min": "", "name": "U1", + "size": "", "type": "complex", "unit": "Vrms", "value": null @@ -1682,6 +1782,7 @@ "max": "", "min": "", "name": "U2", + "size": "", "type": "complex", "unit": "Vrms", "value": null @@ -1692,6 +1793,7 @@ "max": "", "min": "", "name": "If", + "size": "", "type": "complex", "unit": "Arms", "value": null @@ -1702,6 +1804,7 @@ "max": "", "min": "", "name": "Lm", + "size": "", "type": "float", "unit": "H", "value": null @@ -1712,6 +1815,7 @@ "max": "", "min": "", "name": "Im", + "size": "", "type": "complex", "unit": "Arms", "value": null @@ -1745,6 +1849,7 @@ "max": "", "min": "1", "name": "n_interp", + "size": "", "type": "int", "unit": "", "value": 10 @@ -1755,6 +1860,7 @@ "max": "", "min": "", "name": "Id_min", + "size": "", "type": "float", "unit": "Arms", "value": null @@ -1765,6 +1871,7 @@ "max": "", "min": "", "name": "Id_max", + "size": "", "type": "float", "unit": "Arms", "value": null @@ -1775,6 +1882,7 @@ "max": "", "min": "", "name": "Iq_min", + "size": "", "type": "float", "unit": "Arms", "value": null @@ -1785,6 +1893,7 @@ "max": "", "min": "", "name": "Iq_max", + "size": "", "type": "float", "unit": "Arms", "value": null @@ -1795,6 +1904,7 @@ "max": "", "min": "", "name": "n_Id", + "size": "", "type": "int", "unit": "", "value": 1 @@ -1805,6 +1915,7 @@ "max": "", "min": "", "name": "n_Iq", + "size": "", "type": "int", "unit": "", "value": 1 @@ -1815,6 +1926,7 @@ "max": "", "min": "", "name": "LUT_simu", + "size": "", "type": "Simulation", "unit": "", "value": null @@ -1825,6 +1937,7 @@ "max": "", "min": "", "name": "is_grid_dq", + "size": "", "type": "bool", "unit": "", "value": 1 @@ -1835,6 +1948,7 @@ "max": "", "min": "0", "name": "Urms_max", + "size": "0", "type": "float", "unit": "Vrms", "value": null @@ -1845,6 +1959,7 @@ "max": "", "min": "0", "name": "Jrms_max", + "size": "", "type": "float", "unit": "A/m\u00c2\u00b2", "value": null @@ -1855,6 +1970,7 @@ "max": "", "min": "0", "name": "Irms_max", + "size": "0", "type": "float", "unit": "A", "value": null @@ -1865,6 +1981,7 @@ "max": "1", "min": "0", "name": "load_rate", + "size": "", "type": "float", "unit": "", "value": 1 @@ -1900,6 +2017,7 @@ "max": "", "min": "", "name": "eec", + "size": "", "type": "EEC", "unit": "-", "value": null @@ -1910,6 +2028,7 @@ "max": "", "min": "", "name": "logger_name", + "size": "0", "type": "str", "unit": "-", "value": "Pyleecan.Electrical" @@ -1920,6 +2039,7 @@ "max": "", "min": "", "name": "freq_max", + "size": "", "type": "float", "unit": "Hz", "value": 40000 @@ -1930,6 +2050,7 @@ "max": "", "min": "", "name": "LUT_enforced", + "size": "", "type": "LUT", "unit": "-", "value": null @@ -1940,6 +2061,7 @@ "max": "", "min": "", "name": "Tsta", + "size": "0", "type": "float", "unit": "deg Celsius", "value": 20 @@ -1950,6 +2072,7 @@ "max": "", "min": "", "name": "Trot", + "size": "0", "type": "float", "unit": "deg Celsius", "value": 20 @@ -1960,6 +2083,7 @@ "max": "", "min": "", "name": "type_skin_effect", + "size": "1", "type": "int", "unit": "-", "value": 1 @@ -1970,6 +2094,7 @@ "max": "", "min": "", "name": "is_skin_effect_inductance", + "size": "", "type": "bool", "unit": "", "value": 1 @@ -2003,6 +2128,7 @@ "max": "", "min": "", "name": "logger_name", + "size": "0", "type": "str", "unit": "-", "value": "Pyleecan.Elmer" @@ -2035,6 +2161,7 @@ "max": "", "min": "", "name": "data", + "size": "", "type": "dict", "unit": "", "value": "" @@ -2045,6 +2172,7 @@ "max": "", "min": "", "name": "file", + "size": "", "type": "str", "unit": "", "value": "" @@ -2055,6 +2183,7 @@ "max": "", "min": "", "name": "usecols", + "size": "", "type": "list", "unit": "", "value": [] @@ -2065,6 +2194,7 @@ "max": "", "min": "", "name": "columns", + "size": "", "type": "list", "unit": "", "value": [] @@ -2075,6 +2205,7 @@ "max": "", "min": "", "name": "is_scalars", + "size": "", "type": "bool", "unit": "", "value": 0 @@ -2105,6 +2236,7 @@ "max": "", "min": "", "name": "label", + "size": "", "type": "str", "unit": "", "value": "ElmerResults" @@ -2115,6 +2247,7 @@ "max": "", "min": "", "name": "file_path", + "size": "", "type": "str", "unit": "", "value": "" @@ -2125,6 +2258,7 @@ "max": "", "min": "", "name": "store_dict", + "size": "", "type": "dict", "unit": "", "value": "" @@ -2159,6 +2293,7 @@ "max": "", "min": "0", "name": "Lew_enforced", + "size": "", "type": "float", "unit": "H", "value": 0 @@ -2190,6 +2325,7 @@ "max": "", "min": "", "name": "coil_pitch", + "size": "0", "type": "float", "unit": "", "value": null @@ -2221,6 +2357,7 @@ "max": "", "min": "", "name": "coil_pitch", + "size": "0", "type": "float", "unit": "", "value": null @@ -2231,6 +2368,7 @@ "max": "", "min": "0", "name": "lambda_length", + "size": "0", "type": "float", "unit": "", "value": 0 @@ -2241,6 +2379,7 @@ "max": "", "min": "0", "name": "lambda_width", + "size": "0", "type": "float", "unit": "", "value": 0 @@ -2271,6 +2410,7 @@ "max": "", "min": "", "name": "nb_gauss_point", + "size": "0", "type": "int", "unit": "", "value": 4 @@ -2301,6 +2441,7 @@ "max": "", "min": "", "name": "nb_gauss_point", + "size": "0", "type": "int", "unit": "", "value": 3 @@ -2336,6 +2477,7 @@ "max": "", "min": "", "name": "is_periodicity_t", + "size": "0", "type": "bool", "unit": "-", "value": null @@ -2346,6 +2488,7 @@ "max": "", "min": "", "name": "is_periodicity_a", + "size": "0", "type": "bool", "unit": "-", "value": null @@ -2356,6 +2499,7 @@ "max": "", "min": "", "name": "is_agsf_transfer", + "size": "0", "type": "bool", "unit": "-", "value": 0 @@ -2366,6 +2510,7 @@ "max": "", "min": "", "name": "max_wavenumber_transfer", + "size": "0", "type": "int", "unit": "-", "value": null @@ -2376,6 +2521,7 @@ "max": "", "min": "", "name": "Rsbo_enforced_transfer", + "size": "0", "type": "float", "unit": "-", "value": null @@ -2386,6 +2532,7 @@ "max": "", "min": "", "name": "logger_name", + "size": "0", "type": "str", "unit": "-", "value": "Pyleecan.Force" @@ -2439,6 +2586,7 @@ "max": "", "min": "", "name": "group", + "size": "", "type": "str", "unit": "-", "value": "stator core" @@ -2449,6 +2597,7 @@ "max": "", "min": "", "name": "tensor", + "size": "", "type": "dict", "unit": "-", "value": null @@ -2487,6 +2636,7 @@ "max": "", "min": "0", "name": "Lfra", + "size": "0", "type": "float", "unit": "m", "value": 0.35 @@ -2497,6 +2647,7 @@ "max": "", "min": "0", "name": "Rint", + "size": "0", "type": "float", "unit": "m", "value": 0.2 @@ -2507,6 +2658,7 @@ "max": "", "min": "0", "name": "Rext", + "size": "0", "type": "float", "unit": "m", "value": 0.2 @@ -2517,6 +2669,7 @@ "max": "", "min": "", "name": "mat_type", + "size": "", "type": "Material", "unit": "", "value": "" @@ -2552,6 +2705,7 @@ "max": "", "min": "1", "name": "Nbar", + "size": "0", "type": "int", "unit": "m", "value": 8 @@ -2562,6 +2716,7 @@ "max": "", "min": "0", "name": "wbar", + "size": "0", "type": "float", "unit": "m", "value": 0.01 @@ -2590,6 +2745,7 @@ "max": "", "min": "", "name": "unit", + "size": "0", "type": "Unit", "unit": "-", "value": "" @@ -2672,6 +2828,7 @@ "max": "", "min": "0", "name": "Zh", + "size": "0", "type": "int", "unit": "-", "value": 36 @@ -2682,6 +2839,7 @@ "max": "", "min": "", "name": "mat_void", + "size": "0", "type": "Material", "unit": "-", "value": "" @@ -2692,6 +2850,7 @@ "max": "", "min": "", "name": "magnetization_dict_offset", + "size": "0", "type": "dict", "unit": "-", "value": null @@ -2702,6 +2861,7 @@ "max": "6.29", "min": "0", "name": "Alpha0", + "size": "0", "type": "float", "unit": "rad", "value": 0 @@ -2746,6 +2906,7 @@ "max": "", "min": "0", "name": "H0", + "size": "0", "type": "float", "unit": "m", "value": 0.003 @@ -2756,6 +2917,7 @@ "max": "", "min": "0", "name": "W0", + "size": "0", "type": "float", "unit": "m", "value": 0.003 @@ -2766,6 +2928,7 @@ "max": "", "min": "0", "name": "H1", + "size": "0", "type": "float", "unit": "m", "value": 0 @@ -2776,6 +2939,7 @@ "max": "", "min": "0", "name": "W1", + "size": "0", "type": "float", "unit": "m", "value": 0.013 @@ -2786,6 +2950,7 @@ "max": "", "min": "0", "name": "H2", + "size": "0", "type": "float", "unit": "m", "value": 0.02 @@ -2796,6 +2961,7 @@ "max": "", "min": "0", "name": "W2", + "size": "0", "type": "float", "unit": "m", "value": 0.01 @@ -2806,6 +2972,7 @@ "max": "", "min": "0", "name": "H3", + "size": "0", "type": "float", "unit": "m", "value": 0.01 @@ -2816,6 +2983,7 @@ "max": "", "min": "0", "name": "W3", + "size": "0", "type": "float", "unit": "m", "value": 0.01 @@ -2826,6 +2994,7 @@ "max": "", "min": "0", "name": "H4", + "size": "0", "type": "float", "unit": "m", "value": 0 @@ -2836,6 +3005,7 @@ "max": "", "min": "0", "name": "W4", + "size": "0", "type": "float", "unit": "m", "value": 0.01 @@ -2846,6 +3016,7 @@ "max": "", "min": "", "name": "magnet_0", + "size": "0", "type": "Magnet", "unit": "-", "value": "" @@ -2856,6 +3027,7 @@ "max": "", "min": "", "name": "magnet_1", + "size": "0", "type": "Magnet", "unit": "-", "value": "" @@ -2900,6 +3072,7 @@ "max": "", "min": "0", "name": "H0", + "size": "0", "type": "float", "unit": "m", "value": 0.003 @@ -2910,6 +3083,7 @@ "max": "", "min": "0", "name": "H1", + "size": "0", "type": "float", "unit": "m", "value": 0 @@ -2920,6 +3094,7 @@ "max": "", "min": "0", "name": "H2", + "size": "0", "type": "float", "unit": "m", "value": 0.02 @@ -2930,6 +3105,7 @@ "max": "", "min": "0", "name": "W0", + "size": "0", "type": "float", "unit": "m", "value": 0.01 @@ -2940,6 +3116,7 @@ "max": "", "min": "0", "name": "W1", + "size": "0", "type": "float", "unit": "rad", "value": 0 @@ -2950,6 +3127,7 @@ "max": "", "min": "0", "name": "W2", + "size": "0", "type": "float", "unit": "m", "value": 0.01 @@ -2960,6 +3138,7 @@ "max": "", "min": "0", "name": "W3", + "size": "0", "type": "float", "unit": "m", "value": 0 @@ -2970,6 +3149,7 @@ "max": "", "min": "0", "name": "W4", + "size": "0", "type": "float", "unit": "m", "value": 0.01 @@ -2980,6 +3160,7 @@ "max": "", "min": "0", "name": "W5", + "size": "0", "type": "float", "unit": "m", "value": 0.01 @@ -2990,6 +3171,7 @@ "max": "", "min": "0", "name": "W6", + "size": "0", "type": "float", "unit": "m", "value": 0 @@ -3000,6 +3182,7 @@ "max": "", "min": "0", "name": "W7", + "size": "0", "type": "float", "unit": "m", "value": 0 @@ -3010,6 +3193,7 @@ "max": "", "min": "", "name": "magnet_0", + "size": "0", "type": "Magnet", "unit": "-", "value": "" @@ -3020,6 +3204,7 @@ "max": "", "min": "", "name": "magnet_1", + "size": "0", "type": "Magnet", "unit": "-", "value": "" @@ -3030,6 +3215,7 @@ "max": "", "min": "", "name": "magnet_2", + "size": "0", "type": "Magnet", "unit": "-", "value": "" @@ -3075,6 +3261,7 @@ "max": "", "min": "0", "name": "H0", + "size": "0", "type": "float", "unit": "m", "value": 0.003 @@ -3085,6 +3272,7 @@ "max": "", "min": "0", "name": "W0", + "size": "0", "type": "float", "unit": "m", "value": 0.003 @@ -3095,6 +3283,7 @@ "max": "", "min": "0", "name": "H1", + "size": "0", "type": "float", "unit": "m", "value": 0 @@ -3105,6 +3294,7 @@ "max": "", "min": "0", "name": "W3", + "size": "0", "type": "float", "unit": "m", "value": 0.013 @@ -3115,6 +3305,7 @@ "max": "", "min": "0", "name": "H2", + "size": "0", "type": "float", "unit": "m", "value": 0.02 @@ -3125,6 +3316,7 @@ "max": "", "min": "", "name": "magnet_0", + "size": "0", "type": "Magnet", "unit": "-", "value": "" @@ -3170,6 +3362,7 @@ "max": "", "min": "0", "name": "H0", + "size": "0", "type": "float", "unit": "m", "value": 0.003 @@ -3180,6 +3373,7 @@ "max": "", "min": "0", "name": "W0", + "size": "0", "type": "float", "unit": "m", "value": 0.003 @@ -3190,6 +3384,7 @@ "max": "", "min": "0", "name": "H1", + "size": "0", "type": "float", "unit": "m", "value": 0 @@ -3200,6 +3395,7 @@ "max": "", "min": "0", "name": "W1", + "size": "0", "type": "float", "unit": "m", "value": 0.001 @@ -3210,6 +3406,7 @@ "max": "", "min": "0", "name": "H2", + "size": "0", "type": "float", "unit": "m", "value": 0.02 @@ -3220,6 +3417,7 @@ "max": "", "min": "", "name": "magnet_0", + "size": "0", "type": "Magnet", "unit": "-", "value": "" @@ -3230,6 +3428,7 @@ "max": "", "min": "0", "name": "R0", + "size": "0", "type": "float", "unit": "m", "value": 0 @@ -3274,6 +3473,7 @@ "max": "", "min": "0", "name": "H0", + "size": "0", "type": "float", "unit": "m", "value": 0.003 @@ -3284,6 +3484,7 @@ "max": "", "min": "0", "name": "H1", + "size": "0", "type": "float", "unit": "m", "value": 0 @@ -3294,6 +3495,7 @@ "max": "", "min": "0", "name": "W1", + "size": "0", "type": "float", "unit": "m", "value": 0.013 @@ -3304,6 +3506,7 @@ "max": "", "min": "0", "name": "H2", + "size": "0", "type": "float", "unit": "m", "value": 0.02 @@ -3314,6 +3517,7 @@ "max": "", "min": "0", "name": "W2", + "size": "0", "type": "float", "unit": "m", "value": 0.01 @@ -3324,6 +3528,7 @@ "max": "", "min": "0", "name": "H3", + "size": "0", "type": "float", "unit": "m", "value": 0.01 @@ -3334,6 +3539,7 @@ "max": "", "min": "0", "name": "W3", + "size": "0", "type": "float", "unit": "m", "value": 0.01 @@ -3344,6 +3550,7 @@ "max": "", "min": "0", "name": "W4", + "size": "0", "type": "float", "unit": "rad", "value": 0.01 @@ -3354,6 +3561,7 @@ "max": "", "min": "", "name": "magnet_0", + "size": "0", "type": "Magnet", "unit": "-", "value": "" @@ -3364,6 +3572,7 @@ "max": "", "min": "", "name": "magnet_1", + "size": "0", "type": "Magnet", "unit": "-", "value": "" @@ -3404,6 +3613,7 @@ "max": "", "min": "0", "name": "H0", + "size": "0", "type": "float", "unit": "m", "value": 0.003 @@ -3414,6 +3624,7 @@ "max": "", "min": "0", "name": "H1", + "size": "0", "type": "float", "unit": "m", "value": 0 @@ -3424,6 +3635,7 @@ "max": "", "min": "0", "name": "W0", + "size": "0", "type": "float", "unit": "rad", "value": 0.013 @@ -3434,6 +3646,7 @@ "max": "", "min": "0", "name": "R1", + "size": "0", "type": "float", "unit": "m", "value": 0.02 @@ -3476,6 +3689,7 @@ "max": "3.15", "min": "0", "name": "W0", + "size": "0", "type": "float", "unit": "rad", "value": 0.2 @@ -3486,6 +3700,7 @@ "max": "", "min": "0", "name": "H1", + "size": "0", "type": "float", "unit": "m", "value": 0 @@ -3496,6 +3711,7 @@ "max": "", "min": "0", "name": "W1", + "size": "0", "type": "float", "unit": "m", "value": 0.013 @@ -3506,6 +3722,7 @@ "max": "", "min": "0", "name": "H2", + "size": "0", "type": "float", "unit": "m", "value": 0.02 @@ -3516,6 +3733,7 @@ "max": "", "min": "0", "name": "W2", + "size": "0", "type": "float", "unit": "m", "value": 0.01 @@ -3526,6 +3744,7 @@ "max": "", "min": "0", "name": "W3", + "size": "0", "type": "float", "unit": "m", "value": 0.01 @@ -3536,6 +3755,7 @@ "max": "", "min": "0", "name": "W4", + "size": "0", "type": "float", "unit": "m", "value": 0.01 @@ -3546,6 +3766,7 @@ "max": "", "min": "", "name": "magnet_0", + "size": "0", "type": "Magnet", "unit": "-", "value": "" @@ -3556,6 +3777,7 @@ "max": "", "min": "", "name": "magnet_1", + "size": "0", "type": "Magnet", "unit": "-", "value": "" @@ -3598,6 +3820,7 @@ "max": "", "min": "0", "name": "H0", + "size": "0", "type": "float", "unit": "m", "value": 0.003 @@ -3608,6 +3831,7 @@ "max": "", "min": "0", "name": "W0", + "size": "0", "type": "float", "unit": "m", "value": 0.003 @@ -3618,6 +3842,7 @@ "max": "", "min": "0", "name": "H1", + "size": "0", "type": "float", "unit": "m", "value": 0 @@ -3628,6 +3853,7 @@ "max": "", "min": "0", "name": "W1", + "size": "0", "type": "float", "unit": "m", "value": 0.013 @@ -3638,6 +3864,7 @@ "max": "", "min": "0", "name": "H2", + "size": "0", "type": "float", "unit": "m", "value": 0.02 @@ -3648,6 +3875,7 @@ "max": "", "min": "0", "name": "W2", + "size": "0", "type": "float", "unit": "m", "value": 0.01 @@ -3658,6 +3886,7 @@ "max": "", "min": "0", "name": "W3", + "size": "0", "type": "float", "unit": "rad", "value": 0.01 @@ -3668,6 +3897,7 @@ "max": "", "min": "0", "name": "R0", + "size": "0", "type": "float", "unit": "m", "value": 0.01 @@ -3678,6 +3908,7 @@ "max": "", "min": "", "name": "magnet_0", + "size": "0", "type": "Magnet", "unit": "-", "value": "" @@ -3720,6 +3951,7 @@ "max": "", "min": "0", "name": "W0", + "size": "0", "type": "float", "unit": "rad", "value": null @@ -3730,6 +3962,7 @@ "max": "", "min": "0", "name": "W1", + "size": "0", "type": "float", "unit": "m", "value": null @@ -3740,6 +3973,7 @@ "max": "", "min": "0", "name": "W2", + "size": "0", "type": "float", "unit": "m", "value": null @@ -3750,6 +3984,7 @@ "max": "", "min": "0", "name": "W3", + "size": "0", "type": "float", "unit": "m", "value": null @@ -3760,6 +3995,7 @@ "max": "", "min": "0", "name": "H0", + "size": "0", "type": "float", "unit": "m", "value": null @@ -3770,6 +4006,7 @@ "max": "", "min": "0", "name": "H1", + "size": "0", "type": "float", "unit": "m", "value": null @@ -3780,6 +4017,7 @@ "max": "", "min": "", "name": "magnet_0", + "size": "0", "type": "Magnet", "unit": "-", "value": "" @@ -3790,6 +4028,7 @@ "max": "", "min": "", "name": "magnet_1", + "size": "0", "type": "Magnet", "unit": "-", "value": "" @@ -3832,6 +4071,7 @@ "max": "", "min": "0", "name": "W0", + "size": "0", "type": "float", "unit": "m", "value": null @@ -3842,6 +4082,7 @@ "max": "", "min": "0", "name": "W1", + "size": "0", "type": "float", "unit": "m", "value": null @@ -3852,6 +4093,7 @@ "max": "", "min": "0", "name": "W2", + "size": "0", "type": "float", "unit": "m", "value": null @@ -3862,6 +4104,7 @@ "max": "", "min": "0", "name": "W3", + "size": "0", "type": "float", "unit": "m", "value": null @@ -3872,6 +4115,7 @@ "max": "", "min": "0", "name": "H0", + "size": "0", "type": "float", "unit": "m", "value": null @@ -3882,6 +4126,7 @@ "max": "", "min": "0", "name": "H1", + "size": "0", "type": "float", "unit": "m", "value": null @@ -3892,6 +4137,7 @@ "max": "", "min": "0", "name": "H2", + "size": "0", "type": "float", "unit": "m", "value": null @@ -3902,6 +4148,7 @@ "max": "", "min": "", "name": "magnet_0", + "size": "0", "type": "Magnet", "unit": "-", "value": "" @@ -3912,6 +4159,7 @@ "max": "", "min": "", "name": "magnet_1", + "size": "0", "type": "Magnet", "unit": "-", "value": "" @@ -3922,6 +4170,7 @@ "max": "", "min": "", "name": "magnet_2", + "size": "0", "type": "Magnet", "unit": "-", "value": "" @@ -3932,6 +4181,7 @@ "max": "", "min": "", "name": "magnet_3", + "size": "0", "type": "Magnet", "unit": "-", "value": "" @@ -3976,6 +4226,7 @@ "max": "", "min": "0", "name": "W0", + "size": "0", "type": "float", "unit": "m/rad", "value": null @@ -3986,6 +4237,7 @@ "max": "", "min": "0", "name": "H0", + "size": "0", "type": "float", "unit": "m", "value": null @@ -3996,6 +4248,7 @@ "max": "", "min": "0", "name": "H1", + "size": "0", "type": "float", "unit": "m", "value": null @@ -4006,6 +4259,7 @@ "max": "", "min": "", "name": "W0_is_rad", + "size": "0", "type": "bool", "unit": "", "value": 0 @@ -4016,6 +4270,7 @@ "max": "", "min": "", "name": "magnet_0", + "size": "0", "type": "Magnet", "unit": "-", "value": "" @@ -4060,6 +4315,7 @@ "max": "", "min": "0", "name": "W0", + "size": "0", "type": "float", "unit": "m/rad", "value": null @@ -4070,6 +4326,7 @@ "max": "", "min": "0", "name": "H0", + "size": "0", "type": "float", "unit": "m", "value": null @@ -4080,6 +4337,7 @@ "max": "", "min": "0", "name": "H1", + "size": "0", "type": "float", "unit": "m", "value": null @@ -4090,6 +4348,7 @@ "max": "", "min": "", "name": "top_flat", + "size": "0", "type": "bool", "unit": "", "value": 0 @@ -4100,6 +4359,7 @@ "max": "", "min": "", "name": "magnet_0", + "size": "0", "type": "Magnet", "unit": "-", "value": "" @@ -4143,6 +4403,7 @@ "max": "", "min": "0", "name": "H1", + "size": "0", "type": "float", "unit": "m", "value": 0.002373479 @@ -4153,6 +4414,7 @@ "max": "", "min": "0", "name": "W0", + "size": "0", "type": "float", "unit": "m", "value": 0.00388 @@ -4163,6 +4425,7 @@ "max": "", "min": "0", "name": "W1", + "size": "0", "type": "float", "unit": "rad", "value": 0.219911482 @@ -4173,6 +4436,7 @@ "max": "", "min": "0", "name": "W2", + "size": "0", "type": "float", "unit": "m", "value": 0.0007 @@ -4183,6 +4447,7 @@ "max": "", "min": "0", "name": "R1", + "size": "0", "type": "float", "unit": "m", "value": 0.0003 @@ -4193,6 +4458,7 @@ "max": "", "min": "", "name": "R2", + "size": "0", "type": "float", "unit": "m", "value": 0.019327 @@ -4203,6 +4469,7 @@ "max": "", "min": "", "name": "R3", + "size": "0", "type": "float", "unit": "m", "value": 0.0165 @@ -4213,6 +4480,7 @@ "max": "", "min": "", "name": "magnet_0", + "size": "0", "type": "Magnet", "unit": "-", "value": "" @@ -4289,6 +4557,7 @@ "max": "", "min": "", "name": "surf_list", + "size": "", "type": "[Surface]", "unit": "", "value": "" @@ -4299,6 +4568,7 @@ "max": "", "min": "", "name": "magnet_dict", + "size": "", "type": "{Magnet}", "unit": "", "value": "" @@ -4309,6 +4579,7 @@ "max": "", "min": "", "name": "name", + "size": "", "type": "str", "unit": "-", "value": "" @@ -4368,6 +4639,7 @@ "max": "", "min": "", "name": "axes", + "size": "", "type": "[ImportData]", "unit": "-", "value": [] @@ -4378,6 +4650,7 @@ "max": "", "min": "", "name": "field", + "size": "", "type": "Import", "unit": "-", "value": null @@ -4388,6 +4661,7 @@ "max": "", "min": "", "name": "unit", + "size": "", "type": "str", "unit": "-", "value": "SI" @@ -4398,6 +4672,7 @@ "max": "", "min": "", "name": "name", + "size": "", "type": "str", "unit": "-", "value": "" @@ -4408,6 +4683,7 @@ "max": "", "min": "", "name": "symbol", + "size": "", "type": "str", "unit": "-", "value": "" @@ -4418,6 +4694,7 @@ "max": "", "min": "", "name": "normalizations", + "size": "", "type": "dict", "unit": "-", "value": {} @@ -4428,6 +4705,7 @@ "max": "", "min": "", "name": "symmetries", + "size": "", "type": "dict", "unit": "-", "value": {} @@ -4459,6 +4737,7 @@ "max": "", "min": "", "name": "sin_list", + "size": "0", "type": "[ImportGenVectSin]", "unit": "-", "value": "" @@ -4492,6 +4771,7 @@ "max": "", "min": "0", "name": "fs", + "size": "0", "type": "float", "unit": "Hz", "value": 96000 @@ -4502,6 +4782,7 @@ "max": "", "min": "0", "name": "duration", + "size": "0", "type": "float", "unit": "s", "value": 10 @@ -4512,6 +4793,7 @@ "max": "", "min": "0", "name": "f", + "size": "0", "type": "float", "unit": "Hz", "value": 50 @@ -4522,6 +4804,7 @@ "max": "", "min": "0", "name": "fmax", + "size": "0", "type": "float", "unit": "Hz", "value": 0 @@ -4532,6 +4815,7 @@ "max": "", "min": "0", "name": "fmode", + "size": "0", "type": "int", "unit": "", "value": 0 @@ -4542,6 +4826,7 @@ "max": "", "min": "", "name": "fswimode", + "size": "0", "type": "int", "unit": "", "value": 0 @@ -4552,6 +4837,7 @@ "max": "", "min": "", "name": "fswi", + "size": "0", "type": "float", "unit": "Hz", "value": 1000 @@ -4562,6 +4848,7 @@ "max": "", "min": "", "name": "fswi_max", + "size": "0", "type": "float", "unit": "Hz", "value": 3000 @@ -4572,6 +4859,7 @@ "max": "", "min": "", "name": "typePWM", + "size": "0", "type": "int", "unit": "", "value": 8 @@ -4582,6 +4870,7 @@ "max": "", "min": "", "name": "Vdc1", + "size": "0", "type": "float", "unit": "V", "value": 2 @@ -4592,6 +4881,7 @@ "max": "", "min": "", "name": "U0", + "size": "0", "type": "float", "unit": "V", "value": null @@ -4602,6 +4892,7 @@ "max": "", "min": "", "name": "type_carrier", + "size": "0", "type": "int", "unit": "", "value": 0 @@ -4612,6 +4903,7 @@ "max": "", "min": "", "name": "var_amp", + "size": "0", "type": "int", "unit": "%", "value": 20 @@ -4622,6 +4914,7 @@ "max": "", "min": "", "name": "qs", + "size": "0", "type": "int", "unit": "", "value": 3 @@ -4632,6 +4925,7 @@ "max": "", "min": "", "name": "is_star", + "size": "", "type": "bool", "unit": "", "value": 1 @@ -4642,6 +4936,7 @@ "max": "1", "min": "-1", "name": "phase_dir", + "size": "0", "type": "int", "unit": "", "value": -1 @@ -4652,6 +4947,7 @@ "max": "1", "min": "-1", "name": "current_dir", + "size": "0", "type": "int", "unit": "-", "value": -1 @@ -4662,6 +4958,7 @@ "max": "", "min": "", "name": "Phi0", + "size": "0", "type": "float", "unit": "", "value": 0 @@ -4692,6 +4989,7 @@ "max": "2", "min": "0", "name": "type_signal", + "size": "", "type": "int", "unit": "-", "value": 0 @@ -4702,6 +5000,7 @@ "max": "", "min": "0", "name": "f", + "size": "0", "type": "float", "unit": "Hz", "value": 100 @@ -4712,6 +5011,7 @@ "max": "", "min": "", "name": "A", + "size": "0", "type": "float", "unit": "-", "value": 1 @@ -4722,6 +5022,7 @@ "max": "", "min": "0", "name": "N", + "size": "0", "type": "int", "unit": "-", "value": 1024 @@ -4732,6 +5033,7 @@ "max": "", "min": "0", "name": "Tf", + "size": "0", "type": "float", "unit": "s", "value": 1 @@ -4742,6 +5044,7 @@ "max": "", "min": "", "name": "Dt", + "size": "0", "type": "float", "unit": "s", "value": 0 @@ -4774,6 +5077,7 @@ "max": "", "min": "", "name": "start", + "size": "0", "type": "float", "unit": "-", "value": 0 @@ -4784,6 +5088,7 @@ "max": "", "min": "", "name": "stop", + "size": "0", "type": "float", "unit": "-", "value": 1 @@ -4794,6 +5099,7 @@ "max": "", "min": "", "name": "num", + "size": "0", "type": "float", "unit": "-", "value": 100 @@ -4804,6 +5110,7 @@ "max": "", "min": "", "name": "endpoint", + "size": "0", "type": "bool", "unit": "-", "value": 1 @@ -4834,6 +5141,7 @@ "max": "", "min": "0", "name": "f", + "size": "0", "type": "float", "unit": "Hz", "value": 100 @@ -4844,6 +5152,7 @@ "max": "", "min": "", "name": "A", + "size": "0", "type": "float", "unit": "-", "value": 1 @@ -4854,6 +5163,7 @@ "max": "6.29", "min": "-6.29", "name": "Phi", + "size": "0", "type": "float", "unit": "-", "value": 0 @@ -4864,6 +5174,7 @@ "max": "", "min": "0", "name": "N", + "size": "0", "type": "int", "unit": "-", "value": 1024 @@ -4874,6 +5185,7 @@ "max": "", "min": "0", "name": "Tf", + "size": "0", "type": "float", "unit": "s", "value": 1 @@ -4904,6 +5216,7 @@ "max": "", "min": "", "name": "file_path", + "size": "0", "type": "str", "unit": "-", "value": "" @@ -4914,6 +5227,7 @@ "max": "", "min": "", "name": "var_name", + "size": "0", "type": "str", "unit": "-", "value": "" @@ -4953,6 +5267,7 @@ "max": "", "min": "", "name": "is_transpose", + "size": "1", "type": "bool", "unit": "-", "value": 0 @@ -4983,6 +5298,7 @@ "max": "", "min": "", "name": "value", + "size": "2", "type": "ndarray", "unit": "-", "value": "" @@ -5013,6 +5329,7 @@ "max": "", "min": "", "name": "file_path", + "size": "0", "type": "str", "unit": "-", "value": "" @@ -5023,6 +5340,7 @@ "max": "", "min": "", "name": "sheet", + "size": "0", "type": "str", "unit": "-", "value": "" @@ -5033,6 +5351,7 @@ "max": "", "min": "0", "name": "skiprows", + "size": "0", "type": "int", "unit": "-", "value": 0 @@ -5043,6 +5362,7 @@ "max": "", "min": "", "name": "usecols", + "size": "0", "type": "str", "unit": "-", "value": "None" @@ -5053,6 +5373,7 @@ "max": "", "min": "", "name": "axes_colrows", + "size": "0", "type": "dict", "unit": "-", "value": null @@ -5063,6 +5384,7 @@ "max": "", "min": "", "name": "is_allsheets", + "size": "0", "type": "bool", "unit": "-", "value": false @@ -5093,6 +5415,7 @@ "max": "", "min": "", "name": "file_path", + "size": "0", "type": "str", "unit": "-", "value": "" @@ -5123,6 +5446,7 @@ "max": "", "min": "", "name": "file_path", + "size": "0", "type": "str", "unit": "-", "value": "" @@ -5153,6 +5477,7 @@ "max": "", "min": "", "name": "components", + "size": "", "type": "{ImportData}", "unit": "-", "value": {} @@ -5163,6 +5488,7 @@ "max": "", "min": "", "name": "name", + "size": "", "type": "str", "unit": "-", "value": "" @@ -5173,6 +5499,7 @@ "max": "", "min": "", "name": "symbol", + "size": "", "type": "str", "unit": "-", "value": "" @@ -5211,6 +5538,7 @@ "max": "", "min": "", "name": "time", + "size": "Nt_tot", "type": "ImportMatrix", "unit": "s", "value": null @@ -5221,6 +5549,7 @@ "max": "", "min": "", "name": "angle", + "size": "Na_tot", "type": "ImportMatrix", "unit": "rad", "value": null @@ -5231,6 +5560,7 @@ "max": "", "min": "1", "name": "Nt_tot", + "size": "0", "type": "int", "unit": "-", "value": 2048 @@ -5241,6 +5571,7 @@ "max": "", "min": "0", "name": "Nrev", + "size": "", "type": "float", "unit": "-", "value": null @@ -5251,6 +5582,7 @@ "max": "", "min": "1", "name": "Na_tot", + "size": "", "type": "int", "unit": "-", "value": 2048 @@ -5261,6 +5593,7 @@ "max": "", "min": "", "name": "OP", + "size": "", "type": "OP", "unit": "-", "value": null @@ -5271,6 +5604,7 @@ "max": "", "min": "", "name": "t_final", + "size": "", "type": "float", "unit": "", "value": null @@ -5304,6 +5638,7 @@ "max": "", "min": "", "name": "Is", + "size": "(Nt_tot, qs)", "type": "ImportMatrix", "unit": "A", "value": null @@ -5314,6 +5649,7 @@ "max": "", "min": "", "name": "Ir", + "size": "(Nt_tot, qs)", "type": "ImportMatrix", "unit": "A", "value": null @@ -5324,6 +5660,7 @@ "max": "", "min": "", "name": "Is_harm", + "size": "", "type": "ImportData", "unit": "A", "value": null @@ -5354,6 +5691,7 @@ "max": "", "min": "", "name": "per_a", + "size": "", "type": "int", "unit": "-", "value": 1 @@ -5364,6 +5702,7 @@ "max": "", "min": "", "name": "per_t", + "size": "", "type": "int", "unit": "-", "value": 1 @@ -5374,6 +5713,7 @@ "max": "", "min": "", "name": "is_antiper_a", + "size": "", "type": "bool", "unit": "-", "value": 0 @@ -5384,6 +5724,7 @@ "max": "", "min": "", "name": "is_antiper_t", + "size": "", "type": "bool", "unit": "-", "value": 0 @@ -5394,6 +5735,7 @@ "max": "", "min": "", "name": "B_dict", + "size": "", "type": "dict", "unit": "-", "value": null @@ -5404,6 +5746,7 @@ "max": "", "min": "", "name": "unit", + "size": "", "type": "str", "unit": "-", "value": "None" @@ -5414,6 +5757,7 @@ "max": "", "min": "", "name": "slice", + "size": "", "type": "ndarray", "unit": "m", "value": null @@ -5424,6 +5768,7 @@ "max": "", "min": "", "name": "B_enforced", + "size": "", "type": "SciDataTool.Classes.VectorField.VectorField", "unit": "", "value": "None" @@ -5454,6 +5799,7 @@ "max": "", "min": "", "name": "P", + "size": "", "type": "ImportVectorField", "unit": "N.m^2", "value": null @@ -5488,6 +5834,7 @@ "max": "1", "min": "-1", "name": "rot_dir", + "size": "", "type": "int", "unit": "-", "value": null @@ -5498,6 +5845,7 @@ "max": "", "min": "", "name": "angle_rotor_initial", + "size": "", "type": "float", "unit": "", "value": 0 @@ -5508,6 +5856,7 @@ "max": "", "min": "", "name": "PWM", + "size": "", "type": "ImportGenPWM", "unit": "", "value": null @@ -5518,6 +5867,7 @@ "max": "1", "min": "-1", "name": "phase_dir", + "size": "0", "type": "int", "unit": "", "value": null @@ -5528,6 +5878,7 @@ "max": "1", "min": "-1", "name": "current_dir", + "size": "0", "type": "int", "unit": "-", "value": null @@ -5538,6 +5889,7 @@ "max": "", "min": "", "name": "is_periodicity_t", + "size": "0", "type": "bool", "unit": "-", "value": 0 @@ -5548,6 +5900,7 @@ "max": "", "min": "", "name": "is_periodicity_a", + "size": "0", "type": "bool", "unit": "-", "value": 0 @@ -5558,6 +5911,7 @@ "max": "", "min": "", "name": "is_generator", + "size": "", "type": "bool", "unit": "", "value": 0 @@ -5586,6 +5940,7 @@ "max": "", "min": "", "name": "ref_cell", + "size": "", "type": "RefCell", "unit": "", "value": null @@ -5596,6 +5951,7 @@ "max": "", "min": "", "name": "gauss_point", + "size": "", "type": "GaussPoint", "unit": "", "value": null @@ -5606,6 +5962,7 @@ "max": "", "min": "", "name": "scalar_product", + "size": "", "type": "ScalarProduct", "unit": "", "value": null @@ -5670,6 +6027,7 @@ "max": "", "min": "", "name": "Phi_dqh_mean", + "size": "(N_dq, 3)", "type": "ndarray", "unit": "Wbrms", "value": null @@ -5680,6 +6038,7 @@ "max": "", "min": "", "name": "Phi_dqh_mag", + "size": "(Nharm, 3)", "type": "SciDataTool.Classes.DataND.DataND", "unit": "Wbrms", "value": "None" @@ -5763,6 +6122,7 @@ "max": "", "min": "", "name": "hole", + "size": "1", "type": "[Hole]", "unit": "", "value": "" @@ -5801,6 +6161,7 @@ "max": "", "min": "", "name": "hole_north", + "size": "1", "type": "[Hole]", "unit": "", "value": "" @@ -5811,6 +6172,7 @@ "max": "", "min": "", "name": "hole_south", + "size": "1", "type": "[Hole]", "unit": "", "value": "" @@ -5860,6 +6222,7 @@ "max": "", "min": "", "name": "slot", + "size": "", "type": "Slot", "unit": "", "value": "" @@ -5896,6 +6259,7 @@ "max": "", "min": "", "name": "mur_lin_matrix", + "size": "", "type": "ndarray", "unit": "-", "value": null @@ -5906,6 +6270,7 @@ "max": "", "min": "", "name": "Brm20_matrix", + "size": "", "type": "ndarray", "unit": "-", "value": null @@ -5930,6 +6295,7 @@ "comp_volumes", "get_all_mag_obj", "get_magnet_by_label", + "get_polar_eq", "set_Lmag" ], "mother": "LamSlotM", @@ -5943,6 +6309,7 @@ "max": "", "min": "", "name": "magnet", + "size": "", "type": "Magnet", "unit": "-", "value": "" @@ -5983,6 +6350,7 @@ "max": "", "min": "", "name": "magnet_north", + "size": "", "type": "Magnet", "unit": "-", "value": "" @@ -5993,6 +6361,7 @@ "max": "", "min": "", "name": "magnet_south", + "size": "", "type": "Magnet", "unit": "-", "value": "" @@ -6003,6 +6372,7 @@ "max": "", "min": "", "name": "slot_south", + "size": "", "type": "Slot", "unit": "", "value": "" @@ -6043,6 +6413,7 @@ "max": "", "min": "", "name": "slot_list", + "size": "", "type": "[Slot]", "unit": "", "value": "" @@ -6053,6 +6424,7 @@ "max": "", "min": "", "name": "alpha", + "size": "", "type": "ndarray", "unit": "[rad]", "value": "" @@ -6063,6 +6435,7 @@ "max": "", "min": "", "name": "sym_dict_enforced", + "size": "", "type": "dict", "unit": "", "value": null @@ -6100,6 +6473,7 @@ "max": "1", "min": "0", "name": "Ksfill", + "size": "", "type": "float", "unit": "-", "value": null @@ -6110,6 +6484,7 @@ "max": "", "min": "", "name": "winding", + "size": "", "type": "Winding", "unit": "", "value": "" @@ -6163,6 +6538,7 @@ "max": "1", "min": "0", "name": "Ksfill", + "size": "", "type": "float", "unit": "-", "value": null @@ -6173,6 +6549,7 @@ "max": "", "min": "", "name": "winding", + "size": "", "type": "Winding", "unit": "", "value": "" @@ -6217,6 +6594,7 @@ "max": "", "min": "0", "name": "Hscr", + "size": "0", "type": "float", "unit": "m", "value": 0.03 @@ -6227,6 +6605,7 @@ "max": "", "min": "0", "name": "Lscr", + "size": "0", "type": "float", "unit": "m", "value": 0.015 @@ -6237,6 +6616,7 @@ "max": "", "min": "", "name": "ring_mat", + "size": "", "type": "Material", "unit": "", "value": "" @@ -6273,6 +6653,7 @@ "max": "", "min": "", "name": "hole", + "size": "1", "type": "[Hole]", "unit": "", "value": "" @@ -6347,6 +6728,7 @@ "max": "", "min": "0", "name": "L1", + "size": "0", "type": "float", "unit": "m", "value": 0.35 @@ -6357,6 +6739,7 @@ "max": "", "min": "", "name": "mat_type", + "size": "", "type": "Material", "unit": "", "value": "" @@ -6367,6 +6750,7 @@ "max": "", "min": "0", "name": "Nrvd", + "size": "0", "type": "int", "unit": "-", "value": 0 @@ -6377,6 +6761,7 @@ "max": "", "min": "0", "name": "Wrvd", + "size": "0", "type": "float", "unit": "m", "value": 0 @@ -6387,6 +6772,7 @@ "max": "1", "min": "0", "name": "Kf1", + "size": "0", "type": "float", "unit": "-", "value": 0.95 @@ -6397,6 +6783,7 @@ "max": "", "min": "", "name": "is_internal", + "size": "0", "type": "bool", "unit": "-", "value": 1 @@ -6407,6 +6794,7 @@ "max": "", "min": "0", "name": "Rint", + "size": "0", "type": "float", "unit": "m", "value": 0 @@ -6417,6 +6805,7 @@ "max": "", "min": "0", "name": "Rext", + "size": "0", "type": "float", "unit": "m", "value": 1 @@ -6427,6 +6816,7 @@ "max": "", "min": "", "name": "is_stator", + "size": "0", "type": "bool", "unit": "-", "value": 1 @@ -6437,6 +6827,7 @@ "max": "", "min": "", "name": "axial_vent", + "size": "0", "type": "[Hole]", "unit": "-", "value": "" @@ -6447,6 +6838,7 @@ "max": "", "min": "", "name": "notch", + "size": "0", "type": "[Notch]", "unit": "-", "value": "" @@ -6457,6 +6849,7 @@ "max": "", "min": "", "name": "skew", + "size": "", "type": "Skew", "unit": "-", "value": null @@ -6467,6 +6860,7 @@ "max": "", "min": "", "name": "bore", + "size": "", "type": "Bore", "unit": "", "value": null @@ -6477,6 +6871,7 @@ "max": "", "min": "", "name": "yoke", + "size": "", "type": "Bore", "unit": "", "value": null @@ -6513,6 +6908,7 @@ "max": "", "min": "", "name": "prop_dict", + "size": "0", "type": "dict", "unit": "-", "value": null @@ -6547,6 +6943,7 @@ "max": "", "min": "", "name": "logger_name", + "size": "0", "type": "str", "unit": "-", "value": "Pyleecan.Loss" @@ -6557,6 +6954,7 @@ "max": "", "min": "", "name": "model_dict", + "size": "", "type": "{LossModel}", "unit": "", "value": null @@ -6567,6 +6965,7 @@ "max": "", "min": "", "name": "Tsta", + "size": "0", "type": "float", "unit": "deg Celsius", "value": 20 @@ -6577,6 +6976,7 @@ "max": "", "min": "", "name": "Trot", + "size": "0", "type": "float", "unit": "deg Celsius", "value": 20 @@ -6587,6 +6987,7 @@ "max": "", "min": "", "name": "is_get_meshsolution", + "size": "", "type": "bool", "unit": "", "value": 0 @@ -6617,6 +7018,7 @@ "max": "", "min": "", "name": "k_ed", + "size": "", "type": "float", "unit": "W/(m3*T2*Hz2)", "value": null @@ -6627,6 +7029,7 @@ "max": "", "min": "", "name": "k_hy", + "size": "", "type": "float", "unit": "W/(m3*T2*Hz)", "value": null @@ -6637,6 +7040,7 @@ "max": "", "min": "", "name": "k_p", + "size": "", "type": "float", "unit": "W/(m3*T2*Hz2)", "value": null @@ -6647,6 +7051,7 @@ "max": "", "min": "", "name": "type_skin_effect", + "size": "1", "type": "int", "unit": "-", "value": 1 @@ -6683,6 +7088,7 @@ "max": "", "min": "", "name": "name", + "size": "", "type": "str", "unit": "", "value": "" @@ -6693,6 +7099,7 @@ "max": "", "min": "", "name": "group", + "size": "", "type": "str", "unit": "", "value": "" @@ -6703,6 +7110,7 @@ "max": "", "min": "", "name": "is_show_fig", + "size": "", "type": "bool", "unit": "", "value": false @@ -6713,6 +7121,7 @@ "max": "", "min": "", "name": "coeff_dict", + "size": "", "type": "dict", "unit": "", "value": null @@ -6744,6 +7153,7 @@ "max": "", "min": "", "name": "k_hy", + "size": "0", "type": "float", "unit": "W/kg", "value": null @@ -6754,6 +7164,7 @@ "max": "", "min": "", "name": "k_ed", + "size": "0", "type": "float", "unit": "W/kg", "value": null @@ -6764,6 +7175,7 @@ "max": "", "min": "", "name": "k_ex", + "size": "0", "type": "float", "unit": "W/kg", "value": null @@ -6795,6 +7207,7 @@ "max": "", "min": "", "name": "type_skin_effect", + "size": "", "type": "int", "unit": "", "value": 1 @@ -6845,6 +7258,7 @@ "max": "", "min": "", "name": "k_p", + "size": "", "type": "float", "unit": "W/kg", "value": null @@ -6876,6 +7290,7 @@ "max": "", "min": "", "name": "k_hy", + "size": "0", "type": "float", "unit": "W/kg", "value": null @@ -6886,6 +7301,7 @@ "max": "", "min": "", "name": "k_ed", + "size": "0", "type": "float", "unit": "W/kg", "value": null @@ -6896,6 +7312,7 @@ "max": "", "min": "", "name": "alpha_f", + "size": "0", "type": "float", "unit": "-", "value": null @@ -6906,6 +7323,7 @@ "max": "", "min": "", "name": "alpha_B", + "size": "0", "type": "float", "unit": "-", "value": null @@ -6956,6 +7374,7 @@ "max": "", "min": "", "name": "type_skin_effect", + "size": "", "type": "int", "unit": "", "value": 1 @@ -7019,6 +7438,7 @@ "max": "", "min": "", "name": "frame", + "size": "", "type": "Frame", "unit": "", "value": "" @@ -7029,6 +7449,7 @@ "max": "", "min": "", "name": "shaft", + "size": "", "type": "Shaft", "unit": "", "value": "" @@ -7039,6 +7460,7 @@ "max": "", "min": "", "name": "name", + "size": "", "type": "str", "unit": "", "value": "default_machine" @@ -7049,6 +7471,7 @@ "max": "", "min": "", "name": "desc", + "size": "", "type": "str", "unit": "", "value": "" @@ -7059,6 +7482,7 @@ "max": "", "min": "", "name": "type_machine", + "size": "", "type": "int", "unit": "", "value": 1 @@ -7069,6 +7493,7 @@ "max": "", "min": "", "name": "logger_name", + "size": "0", "type": "str", "unit": "-", "value": "Pyleecan.Machine" @@ -7125,6 +7550,7 @@ "max": "", "min": "", "name": "rotor", + "size": "", "type": "LamSlotWind", "unit": "", "value": "" @@ -7135,6 +7561,7 @@ "max": "", "min": "", "name": "stator", + "size": "", "type": "LamSlotWind", "unit": "", "value": "" @@ -7166,6 +7593,7 @@ "max": "", "min": "", "name": "rotor", + "size": "", "type": "LamH", "unit": "", "value": "" @@ -7176,6 +7604,7 @@ "max": "", "min": "", "name": "stator", + "size": "", "type": "Lamination", "unit": "", "value": "" @@ -7207,6 +7636,7 @@ "max": "", "min": "", "name": "rotor", + "size": "", "type": "LamSquirrelCageMag", "unit": "", "value": "" @@ -7217,6 +7647,7 @@ "max": "", "min": "", "name": "stator", + "size": "", "type": "LamSlotWind", "unit": "", "value": "" @@ -7268,6 +7699,7 @@ "max": "", "min": "", "name": "rotor", + "size": "", "type": "LamSlotM", "unit": "", "value": "" @@ -7278,6 +7710,7 @@ "max": "", "min": "", "name": "stator", + "size": "", "type": "Lamination", "unit": "", "value": "" @@ -7311,6 +7744,7 @@ "max": "", "min": "", "name": "rotor", + "size": "", "type": "LamSlot", "unit": "", "value": "" @@ -7321,6 +7755,7 @@ "max": "", "min": "", "name": "stator", + "size": "", "type": "LamSlotWind", "unit": "", "value": "" @@ -7352,6 +7787,7 @@ "max": "", "min": "", "name": "rotor", + "size": "", "type": "LamHole", "unit": "", "value": "" @@ -7362,6 +7798,7 @@ "max": "", "min": "", "name": "stator", + "size": "", "type": "LamSlotWind", "unit": "", "value": "" @@ -7420,6 +7857,7 @@ "max": "", "min": "", "name": "lam_list", + "size": "", "type": "[Lamination]", "unit": "", "value": "" @@ -7430,6 +7868,7 @@ "max": "", "min": "", "name": "is_sync", + "size": "", "type": "bool", "unit": "", "value": true @@ -7461,6 +7900,7 @@ "max": "", "min": "", "name": "rotor", + "size": "", "type": "LamSlotWind", "unit": "", "value": "" @@ -7471,6 +7911,7 @@ "max": "", "min": "", "name": "stator", + "size": "", "type": "LamSlotWind", "unit": "", "value": "" @@ -7506,6 +7947,7 @@ "max": "", "min": "", "name": "Kmesh_fineness", + "size": "0", "type": "float", "unit": "", "value": 1 @@ -7516,6 +7958,7 @@ "max": "", "min": "", "name": "Kgeo_fineness", + "size": "0", "type": "float", "unit": "", "value": 1 @@ -7526,6 +7969,7 @@ "max": "", "min": "", "name": "file_name", + "size": "0", "type": "str", "unit": "", "value": "" @@ -7536,6 +7980,7 @@ "max": "", "min": "", "name": "FEA_dict", + "size": "0", "type": "dict", "unit": "", "value": "" @@ -7546,6 +7991,7 @@ "max": "", "min": "", "name": "is_get_mesh", + "size": "0", "type": "bool", "unit": "", "value": 0 @@ -7556,6 +8002,7 @@ "max": "", "min": "", "name": "is_save_FEA", + "size": "0", "type": "bool", "unit": "", "value": 0 @@ -7566,6 +8013,7 @@ "max": "", "min": "", "name": "transform_list", + "size": "0", "type": "list", "unit": "", "value": [] @@ -7576,6 +8024,7 @@ "max": "", "min": "", "name": "rotor_dxf", + "size": "", "type": "DXFImport", "unit": "", "value": null @@ -7586,6 +8035,7 @@ "max": "", "min": "", "name": "stator_dxf", + "size": "", "type": "DXFImport", "unit": "", "value": null @@ -7596,6 +8046,7 @@ "max": "", "min": "", "name": "import_file", + "size": "0", "type": "str", "unit": "", "value": "" @@ -7606,6 +8057,7 @@ "max": "", "min": "", "name": "nb_worker", + "size": "", "type": "int", "unit": "", "value": 1 @@ -7642,6 +8094,7 @@ "max": "", "min": "", "name": "Kmesh_fineness", + "size": "0", "type": "float", "unit": "", "value": 1 @@ -7652,6 +8105,7 @@ "max": "", "min": "", "name": "Kgeo_fineness", + "size": "0", "type": "float", "unit": "", "value": 1 @@ -7662,6 +8116,7 @@ "max": "1", "min": "0", "name": "type_calc_leakage", + "size": "0", "type": "int", "unit": "", "value": 0 @@ -7672,6 +8127,7 @@ "max": "", "min": "", "name": "file_name", + "size": "0", "type": "str", "unit": "", "value": "" @@ -7682,6 +8138,7 @@ "max": "", "min": "", "name": "FEMM_dict_enforced", + "size": "0", "type": "dict", "unit": "", "value": "" @@ -7692,6 +8149,7 @@ "max": "", "min": "", "name": "is_get_meshsolution", + "size": "0", "type": "bool", "unit": "", "value": 0 @@ -7702,6 +8160,7 @@ "max": "", "min": "", "name": "is_save_meshsolution_as_file", + "size": "0", "type": "bool", "unit": "", "value": 0 @@ -7712,6 +8171,7 @@ "max": "", "min": "", "name": "is_sliding_band", + "size": "0", "type": "bool", "unit": "", "value": 1 @@ -7722,6 +8182,7 @@ "max": "", "min": "", "name": "transform_list", + "size": "0", "type": "list", "unit": "", "value": [] @@ -7732,6 +8193,7 @@ "max": "", "min": "", "name": "rotor_dxf", + "size": "", "type": "DXFImport", "unit": "", "value": null @@ -7742,6 +8204,7 @@ "max": "", "min": "", "name": "stator_dxf", + "size": "", "type": "DXFImport", "unit": "", "value": null @@ -7752,6 +8215,7 @@ "max": "", "min": "", "name": "import_file", + "size": "0", "type": "str", "unit": "", "value": "None" @@ -7762,6 +8226,7 @@ "max": "", "min": "", "name": "is_close_femm", + "size": "0", "type": "bool", "unit": "", "value": 1 @@ -7772,6 +8237,7 @@ "max": "", "min": "", "name": "nb_worker", + "size": "", "type": "int", "unit": "", "value": 1 @@ -7782,6 +8248,7 @@ "max": "", "min": "", "name": "Rag_enforced", + "size": "0", "type": "float", "unit": "m", "value": null @@ -7792,6 +8259,7 @@ "max": "", "min": "", "name": "is_set_previous", + "size": "", "type": "bool", "unit": "", "value": 1 @@ -7802,6 +8270,7 @@ "max": "", "min": "", "name": "is_fast_draw", + "size": "0", "type": "bool", "unit": "", "value": 1 @@ -7812,12 +8281,55 @@ "max": "", "min": "", "name": "is_calc_torque_energy", + "size": "", "type": "bool", "unit": "", "value": 1 } ] }, + "MagSDM": { + "constants": [ + { + "name": "VERSION", + "value": "1" + } + ], + "daughters": [], + "desc": "", + "is_internal": false, + "methods": [ + "comp_flux_airgap" + ], + "mother": "Magnetics", + "name": "MagSDM", + "package": "Simulation", + "path": "pyleecan/Generator/ClassesRef/Simulation/MagSDM.csv", + "properties": [ + { + "as_dict": "", + "desc": "The subdomain model object defined to calculate airgap flux density", + "max": "", + "min": "", + "name": "subdomain_model", + "size": "", + "type": "SubdomainModel", + "unit": "", + "value": null + }, + { + "as_dict": "", + "desc": "Scaling coefficient to calculate more or less harmonics in subdomains", + "max": "", + "min": "0", + "name": "Nharm_coeff", + "size": "", + "type": "float", + "unit": "", + "value": 1 + } + ] + }, "Magnet": { "constants": [ { @@ -7840,6 +8352,7 @@ "max": "", "min": "", "name": "mat_type", + "size": "0", "type": "Material", "unit": "", "value": "" @@ -7850,6 +8363,7 @@ "max": "3", "min": "0", "name": "type_magnetization", + "size": "0", "type": "int", "unit": "-", "value": 0 @@ -7860,6 +8374,7 @@ "max": "", "min": "0", "name": "Lmag", + "size": "0", "type": "float", "unit": "-", "value": 0.95 @@ -7870,6 +8385,7 @@ "max": "", "min": "1", "name": "Nseg", + "size": "", "type": "int", "unit": "", "value": 1 @@ -7885,7 +8401,8 @@ ], "daughters": [ "MagElmer", - "MagFEMM" + "MagFEMM", + "MagSDM" ], "desc": "Magnetic module abstract object", "is_internal": false, @@ -7906,6 +8423,7 @@ "max": "", "min": "", "name": "is_remove_slotS", + "size": "0", "type": "bool", "unit": "-", "value": 0 @@ -7916,6 +8434,7 @@ "max": "", "min": "", "name": "is_remove_slotR", + "size": "0", "type": "bool", "unit": "-", "value": 0 @@ -7926,6 +8445,7 @@ "max": "", "min": "", "name": "is_remove_ventS", + "size": "0", "type": "bool", "unit": "-", "value": 0 @@ -7936,6 +8456,7 @@ "max": "", "min": "", "name": "is_remove_ventR", + "size": "0", "type": "bool", "unit": "-", "value": 0 @@ -7946,6 +8467,7 @@ "max": "", "min": "", "name": "is_mmfs", + "size": "0", "type": "bool", "unit": "-", "value": 1 @@ -7956,6 +8478,7 @@ "max": "", "min": "", "name": "is_mmfr", + "size": "0", "type": "bool", "unit": "-", "value": 1 @@ -7966,6 +8489,7 @@ "max": "2", "min": "0", "name": "type_BH_stator", + "size": "0", "type": "int", "unit": "-", "value": 0 @@ -7976,6 +8500,7 @@ "max": "2", "min": "0", "name": "type_BH_rotor", + "size": "0", "type": "int", "unit": "-", "value": 0 @@ -7986,6 +8511,7 @@ "max": "", "min": "", "name": "is_periodicity_t", + "size": "0", "type": "bool", "unit": "-", "value": 0 @@ -7996,6 +8522,7 @@ "max": "", "min": "", "name": "is_periodicity_a", + "size": "0", "type": "bool", "unit": "-", "value": 0 @@ -8006,6 +8533,7 @@ "max": "", "min": "", "name": "angle_stator_shift", + "size": "0", "type": "float", "unit": "rad", "value": 0 @@ -8016,6 +8544,7 @@ "max": "", "min": "", "name": "angle_rotor_shift", + "size": "0", "type": "float", "unit": "rad", "value": 0 @@ -8026,6 +8555,7 @@ "max": "", "min": "", "name": "logger_name", + "size": "0", "type": "str", "unit": "-", "value": "Pyleecan.Magnetics" @@ -8036,6 +8566,7 @@ "max": "", "min": "", "name": "Slice_enforced", + "size": "0", "type": "SliceModel", "unit": "-", "value": null @@ -8046,6 +8577,7 @@ "max": "", "min": "", "name": "Nslices_enforced", + "size": "", "type": "int", "unit": "", "value": null @@ -8056,6 +8588,7 @@ "max": "", "min": "", "name": "type_distribution_enforced", + "size": "", "type": "str", "unit": "-", "value": "None" @@ -8066,6 +8599,7 @@ "max": "", "min": "", "name": "is_current_harm", + "size": "0", "type": "bool", "unit": "", "value": 1 @@ -8076,6 +8610,7 @@ "max": "", "min": "", "name": "T_mag", + "size": "", "type": "float", "unit": "deg Celsius", "value": 20 @@ -8086,6 +8621,7 @@ "max": "", "min": "", "name": "is_periodicity_rotor", + "size": "", "type": "bool", "unit": "", "value": 0 @@ -8114,6 +8650,7 @@ "max": "", "min": "0", "name": "cost_unit", + "size": "0", "type": "float", "unit": "unit/kg", "value": 0.127 @@ -8124,6 +8661,7 @@ "max": "", "min": "", "name": "unit_name", + "size": "0", "type": "str", "unit": "-", "value": "$" @@ -8155,6 +8693,7 @@ "max": "", "min": "0", "name": "rho", + "size": "0", "type": "float", "unit": "ohm.m", "value": 0 @@ -8165,6 +8704,7 @@ "max": "", "min": "0", "name": "epsr", + "size": "0", "type": "float", "unit": "-", "value": 1 @@ -8175,6 +8715,7 @@ "max": "", "min": "0", "name": "alpha", + "size": "0", "type": "float", "unit": "1/K", "value": 0 @@ -8203,6 +8744,7 @@ "max": "", "min": "0", "name": "lambda_x", + "size": "0", "type": "float", "unit": "W/K", "value": 1 @@ -8213,6 +8755,7 @@ "max": "", "min": "0", "name": "lambda_y", + "size": "0", "type": "float", "unit": "W/K", "value": 1 @@ -8223,6 +8766,7 @@ "max": "", "min": "0", "name": "lambda_z", + "size": "0", "type": "float", "unit": "W/K", "value": 1 @@ -8233,6 +8777,7 @@ "max": "", "min": "0", "name": "Cp", + "size": "0", "type": "float", "unit": "W/kg/K", "value": 1 @@ -8243,6 +8788,7 @@ "max": "", "min": "0", "name": "alpha", + "size": "0", "type": "float", "unit": "-", "value": 0 @@ -8276,6 +8822,7 @@ "max": "", "min": "0", "name": "mur_lin", + "size": "0", "type": "float", "unit": "-", "value": 1 @@ -8286,6 +8833,7 @@ "max": "", "min": "", "name": "Brm20", + "size": "0", "type": "float", "unit": "T", "value": 0 @@ -8296,6 +8844,7 @@ "max": "", "min": "", "name": "alpha_Br", + "size": "0", "type": "float", "unit": "-", "value": 0 @@ -8306,6 +8855,7 @@ "max": "", "min": "0", "name": "Wlam", + "size": "0", "type": "float", "unit": "m", "value": 0 @@ -8316,6 +8866,7 @@ "max": "", "min": "", "name": "BH_curve", + "size": "0", "type": "ImportMatrix", "unit": "-", "value": "" @@ -8326,6 +8877,7 @@ "max": "", "min": "", "name": "LossData", + "size": "0", "type": "ImportMatrix", "unit": "W/kg", "value": "" @@ -8336,6 +8888,7 @@ "max": "", "min": "", "name": "ModelBH", + "size": "0", "type": "ModelBH", "unit": "-", "value": "" @@ -8346,6 +8899,7 @@ "max": "", "min": "", "name": "is_BH_extrapolate", + "size": "0", "type": "bool", "unit": "-", "value": 0 @@ -8374,6 +8928,7 @@ "max": "", "min": "0", "name": "rho", + "size": "0", "type": "float", "unit": "kg/m^3", "value": 7650 @@ -8384,6 +8939,7 @@ "max": "", "min": "0", "name": "Ex", + "size": "0", "type": "float", "unit": "Pa", "value": 215000000000.0 @@ -8394,6 +8950,7 @@ "max": "", "min": "0", "name": "Ey", + "size": "0", "type": "float", "unit": "Pa", "value": 215000000000.0 @@ -8404,6 +8961,7 @@ "max": "", "min": "0", "name": "Ez", + "size": "0", "type": "float", "unit": "Pa", "value": 80000000000 @@ -8414,6 +8972,7 @@ "max": "", "min": "0", "name": "nu_xy", + "size": "0", "type": "float", "unit": "-", "value": 0.3 @@ -8424,6 +8983,7 @@ "max": "", "min": "0", "name": "nu_xz", + "size": "0", "type": "float", "unit": "-", "value": 0.03 @@ -8434,6 +8994,7 @@ "max": "", "min": "0", "name": "nu_yz", + "size": "0", "type": "float", "unit": "-", "value": 0.03 @@ -8444,6 +9005,7 @@ "max": "", "min": "0", "name": "Gxz", + "size": "0", "type": "float", "unit": "Pa", "value": 2000000000 @@ -8454,6 +9016,7 @@ "max": "", "min": "0", "name": "Gxy", + "size": "0", "type": "float", "unit": "Pa", "value": 0 @@ -8464,6 +9027,7 @@ "max": "", "min": "0", "name": "Gyz", + "size": "0", "type": "float", "unit": "Pa", "value": 2000000000 @@ -8492,6 +9056,7 @@ "max": "", "min": "", "name": "name", + "size": "0", "type": "str", "unit": "", "value": "Material" @@ -8502,6 +9067,7 @@ "max": "", "min": "", "name": "is_isotropic", + "size": "0", "type": "bool", "unit": "-", "value": 0 @@ -8512,6 +9078,7 @@ "max": "", "min": "", "name": "elec", + "size": "0", "type": "MatElectrical", "unit": "", "value": "" @@ -8522,6 +9089,7 @@ "max": "", "min": "", "name": "mag", + "size": "0", "type": "MatMagnetics", "unit": "", "value": "" @@ -8532,6 +9100,7 @@ "max": "", "min": "", "name": "struct", + "size": "0", "type": "MatStructural", "unit": "", "value": "" @@ -8542,6 +9111,7 @@ "max": "", "min": "", "name": "HT", + "size": "0", "type": "MatHT", "unit": "", "value": "" @@ -8552,6 +9122,7 @@ "max": "", "min": "", "name": "eco", + "size": "0", "type": "MatEconomical", "unit": "", "value": "" @@ -8562,6 +9133,7 @@ "max": "", "min": "", "name": "desc", + "size": "0", "type": "str", "unit": "", "value": "Material description" @@ -8572,6 +9144,7 @@ "max": "", "min": "", "name": "path", + "size": "0", "type": "str", "unit": "", "value": "" @@ -8603,6 +9176,7 @@ "max": "", "min": "", "name": "label", + "size": "", "type": "str", "unit": "-", "value": "None" @@ -8613,6 +9187,7 @@ "max": "3", "min": "1", "name": "dimension", + "size": "", "type": "int", "unit": "", "value": 2 @@ -8655,6 +9230,7 @@ "max": "", "min": "", "name": "cell", + "size": "", "type": "{CellMat}", "unit": "", "value": "" @@ -8665,6 +9241,7 @@ "max": "", "min": "", "name": "node", + "size": "", "type": "NodeMat", "unit": "", "value": "" @@ -8675,6 +9252,7 @@ "max": "", "min": "", "name": "_is_renum", + "size": "", "type": "bool", "unit": "", "value": 0 @@ -8685,6 +9263,7 @@ "max": "", "min": "", "name": "sym", + "size": "", "type": "int", "unit": "", "value": 1 @@ -8695,6 +9274,7 @@ "max": "", "min": "", "name": "is_antiper_a", + "size": "", "type": "bool", "unit": "", "value": false @@ -8736,6 +9316,7 @@ "max": "", "min": "", "name": "label", + "size": "", "type": "str", "unit": "", "value": "" @@ -8746,6 +9327,7 @@ "max": "", "min": "", "name": "mesh", + "size": "", "type": "[Mesh]", "unit": "", "value": "" @@ -8756,6 +9338,7 @@ "max": "", "min": "", "name": "is_same_mesh", + "size": "", "type": "bool", "unit": "", "value": 1 @@ -8766,6 +9349,7 @@ "max": "", "min": "", "name": "solution", + "size": "", "type": "[Solution]", "unit": "", "value": "" @@ -8776,6 +9360,7 @@ "max": "", "min": "", "name": "group", + "size": "", "type": "dict", "unit": "", "value": null @@ -8786,6 +9371,7 @@ "max": "3", "min": "1", "name": "dimension", + "size": "", "type": "int", "unit": "", "value": 2 @@ -8796,6 +9382,7 @@ "max": "", "min": "", "name": "path", + "size": "", "type": "str", "unit": "", "value": "None" @@ -8834,6 +9421,7 @@ "max": "", "min": "", "name": "mesh", + "size": "", "type": "vtk.vtkPointSet", "unit": "", "value": "None" @@ -8844,6 +9432,7 @@ "max": "", "min": "", "name": "is_pyvista_mesh", + "size": "", "type": "bool", "unit": "", "value": false @@ -8854,6 +9443,7 @@ "max": "", "min": "", "name": "format", + "size": "", "type": "str", "unit": "", "value": "vtk" @@ -8864,6 +9454,7 @@ "max": "", "min": "", "name": "path", + "size": "", "type": "str", "unit": "", "value": "None" @@ -8874,6 +9465,7 @@ "max": "", "min": "", "name": "name", + "size": "", "type": "str", "unit": "", "value": "mesh" @@ -8884,6 +9476,7 @@ "max": "", "min": "", "name": "surf", + "size": "", "type": "pyvista.core.pointset.PolyData", "unit": "", "value": "None" @@ -8894,6 +9487,7 @@ "max": "", "min": "", "name": "is_vtk_surf", + "size": "", "type": "bool", "unit": "", "value": false @@ -8904,6 +9498,7 @@ "max": "", "min": "", "name": "surf_path", + "size": "", "type": "str", "unit": "", "value": "" @@ -8914,6 +9509,7 @@ "max": "", "min": "", "name": "surf_name", + "size": "", "type": "str", "unit": "", "value": "" @@ -8924,6 +9520,7 @@ "max": "", "min": "", "name": "node_normals", + "size": "", "type": "ndarray", "unit": "", "value": null @@ -8957,6 +9554,7 @@ "max": "", "min": "", "name": "nat_freq", + "size": "", "type": "float", "unit": "Hz", "value": null @@ -8967,6 +9565,7 @@ "max": "", "min": "0", "name": "order_circ", + "size": "", "type": "int", "unit": "-", "value": null @@ -8977,6 +9576,7 @@ "max": "", "min": "0", "name": "order_long", + "size": "", "type": "int", "unit": "-", "value": null @@ -9012,6 +9612,7 @@ "max": "", "min": "", "name": "Bmax", + "size": "0", "type": "float", "unit": "T", "value": 2.31 @@ -9022,6 +9623,7 @@ "max": "", "min": "", "name": "Hmax", + "size": "0", "type": "float", "unit": "A/m", "value": null @@ -9032,6 +9634,7 @@ "max": "", "min": "", "name": "delta", + "size": "0", "type": "float", "unit": "A/m", "value": 100 @@ -9063,6 +9666,7 @@ "max": "", "min": "", "name": "Bs", + "size": "", "type": "float", "unit": "T", "value": null @@ -9073,6 +9677,7 @@ "max": "", "min": "", "name": "a", + "size": "", "type": "float", "unit": "-", "value": null @@ -9083,6 +9688,7 @@ "max": "", "min": "", "name": "param1", + "size": "", "type": "float", "unit": "-", "value": 1.89 @@ -9093,6 +9699,7 @@ "max": "", "min": "", "name": "param2", + "size": "", "type": "float", "unit": "-", "value": 240 @@ -9121,6 +9728,7 @@ "max": "", "min": "", "name": "k", + "size": "", "type": "float", "unit": "T", "value": null @@ -9131,6 +9739,7 @@ "max": "", "min": "", "name": "mu_a", + "size": "", "type": "float", "unit": "-", "value": null @@ -9159,6 +9768,7 @@ "max": "", "min": "", "name": "Bs", + "size": "", "type": "float", "unit": "T", "value": null @@ -9169,6 +9779,7 @@ "max": "", "min": "", "name": "mu_a", + "size": "", "type": "float", "unit": "-", "value": null @@ -9200,6 +9811,7 @@ "max": "", "min": "", "name": "Bs", + "size": "", "type": "float", "unit": "T", "value": null @@ -9210,6 +9822,7 @@ "max": "", "min": "", "name": "mu_a", + "size": "", "type": "float", "unit": "-", "value": null @@ -9220,6 +9833,7 @@ "max": "", "min": "", "name": "param1", + "size": "", "type": "float", "unit": "-", "value": 1.89 @@ -9230,6 +9844,7 @@ "max": "", "min": "", "name": "param2", + "size": "", "type": "float", "unit": "-", "value": 240 @@ -9263,6 +9878,7 @@ "max": "", "min": "", "name": "coordinate", + "size": "", "type": "ndarray", "unit": "", "value": "" @@ -9273,6 +9889,7 @@ "max": "", "min": "", "name": "nb_node", + "size": "", "type": "int", "unit": "", "value": 0 @@ -9283,6 +9900,7 @@ "max": "", "min": "", "name": "delta", + "size": "", "type": "float", "unit": "", "value": 1e-10 @@ -9293,6 +9911,7 @@ "max": "", "min": "", "name": "indice", + "size": "", "type": "ndarray", "unit": "", "value": "" @@ -9329,6 +9948,7 @@ "max": "", "min": "", "name": "key_mat", + "size": "0", "type": "Material", "unit": "", "value": null @@ -9363,6 +9983,7 @@ "max": "", "min": "", "name": "alpha", + "size": "0", "type": "float", "unit": "rad", "value": 0 @@ -9373,6 +9994,7 @@ "max": "", "min": "", "name": "notch_shape", + "size": "0", "type": "Slot", "unit": "-", "value": "" @@ -9408,6 +10030,7 @@ "max": "", "min": "", "name": "N0", + "size": "1", "type": "float", "unit": "rpm", "value": null @@ -9418,6 +10041,7 @@ "max": "", "min": "", "name": "felec", + "size": "1", "type": "float", "unit": "Hz", "value": null @@ -9428,6 +10052,7 @@ "max": "", "min": "", "name": "Tem_av_ref", + "size": "", "type": "float", "unit": "N.m", "value": null @@ -9438,6 +10063,7 @@ "max": "", "min": "", "name": "Pem_av_ref", + "size": "", "type": "float", "unit": "W", "value": null @@ -9448,6 +10074,7 @@ "max": "", "min": "", "name": "Pem_av_in", + "size": "", "type": "float", "unit": "W", "value": null @@ -9458,6 +10085,7 @@ "max": "", "min": "", "name": "efficiency", + "size": "", "type": "float", "unit": "", "value": null @@ -9495,6 +10123,7 @@ "max": "", "min": "", "name": "N0", + "size": "1", "type": "ndarray", "unit": "rpm", "value": null @@ -9505,6 +10134,7 @@ "max": "", "min": "", "name": "Id_ref", + "size": "1", "type": "ndarray", "unit": "Arms", "value": null @@ -9515,6 +10145,7 @@ "max": "", "min": "", "name": "Iq_ref", + "size": "1", "type": "ndarray", "unit": "Arms", "value": null @@ -9525,6 +10156,7 @@ "max": "", "min": "", "name": "Ud_ref", + "size": "1", "type": "ndarray", "unit": "Vrms", "value": null @@ -9535,6 +10167,7 @@ "max": "", "min": "", "name": "Uq_ref", + "size": "1", "type": "ndarray", "unit": "Vrms", "value": null @@ -9545,6 +10178,7 @@ "max": "", "min": "", "name": "Tem_av_ref", + "size": "", "type": "ndarray", "unit": "N.m", "value": null @@ -9555,6 +10189,7 @@ "max": "", "min": "", "name": "Pem_av_ref", + "size": "", "type": "ndarray", "unit": "W", "value": null @@ -9565,6 +10200,7 @@ "max": "", "min": "", "name": "slip_ref", + "size": "", "type": "ndarray", "unit": "", "value": null @@ -9575,6 +10211,7 @@ "max": "", "min": "", "name": "is_output_power", + "size": "", "type": "bool", "unit": "", "value": 1 @@ -9585,6 +10222,7 @@ "max": "", "min": "", "name": "If_ref", + "size": "", "type": "ndarray", "unit": "Arms", "value": null @@ -9595,6 +10233,7 @@ "max": "", "min": "", "name": "col_names", + "size": "", "type": "list", "unit": "-", "value": null @@ -9637,6 +10276,7 @@ "max": "", "min": "", "name": "Id_ref", + "size": "1", "type": "float", "unit": "Arms", "value": null @@ -9647,6 +10287,7 @@ "max": "", "min": "", "name": "Iq_ref", + "size": "1", "type": "float", "unit": "Arms", "value": null @@ -9657,6 +10298,7 @@ "max": "", "min": "", "name": "Ud_ref", + "size": "1", "type": "float", "unit": "Vrms", "value": null @@ -9667,6 +10309,7 @@ "max": "", "min": "", "name": "Uq_ref", + "size": "1", "type": "float", "unit": "Vrms", "value": null @@ -9695,6 +10338,7 @@ "max": "", "min": "", "name": "If_ref", + "size": "", "type": "float", "unit": "Arms", "value": null @@ -9735,6 +10379,7 @@ "max": "", "min": "", "name": "I0_ref", + "size": "1", "type": "float", "unit": "Arms", "value": null @@ -9745,6 +10390,7 @@ "max": "", "min": "", "name": "IPhi0_ref", + "size": "1", "type": "float", "unit": "rad", "value": null @@ -9755,6 +10401,7 @@ "max": "", "min": "", "name": "slip_ref", + "size": "", "type": "float", "unit": "", "value": 0 @@ -9765,6 +10412,7 @@ "max": "", "min": "", "name": "U0_ref", + "size": "", "type": "float", "unit": "Vrms", "value": null @@ -9775,6 +10423,7 @@ "max": "", "min": "", "name": "UPhi0_ref", + "size": "", "type": "float", "unit": "rad", "value": null @@ -9805,6 +10454,7 @@ "max": "", "min": "1", "name": "nb_iter", + "size": "1", "type": "int", "unit": "-", "value": 15 @@ -9815,6 +10465,7 @@ "max": "", "min": "1", "name": "nb_start", + "size": "1", "type": "int", "unit": "-", "value": 300 @@ -9825,6 +10476,7 @@ "max": "", "min": "", "name": "criterion", + "size": "1", "type": "str", "unit": "-", "value": "PI" @@ -9835,6 +10487,7 @@ "max": "0", "min": "0", "name": "kernel", + "size": "1", "type": "int", "unit": "-", "value": 0 @@ -9869,6 +10522,7 @@ "max": "", "min": "1", "name": "size_pop", + "size": "1", "type": "int", "unit": "-", "value": 40 @@ -9879,6 +10533,7 @@ "max": "", "min": "1", "name": "nb_gen", + "size": "1", "type": "int", "unit": "-", "value": 100 @@ -9907,6 +10562,7 @@ "max": "", "min": "", "name": "type_const", + "size": "1", "type": "str", "unit": "", "value": "<=" @@ -9917,6 +10573,7 @@ "max": "", "min": "", "name": "value", + "size": "2", "type": "float", "unit": "", "value": 0 @@ -9948,6 +10605,7 @@ "max": "", "min": "", "name": "space", + "size": "2", "type": "list", "unit": "", "value": [ @@ -9961,6 +10619,7 @@ "max": "", "min": "", "name": "get_value", + "size": "1", "type": "function", "unit": "", "value": null @@ -10025,6 +10684,7 @@ "max": "", "min": "", "name": "selector", + "size": "1", "type": "function", "unit": "-", "value": null @@ -10035,6 +10695,7 @@ "max": "", "min": "", "name": "crossover", + "size": "1", "type": "function", "unit": "-", "value": null @@ -10045,6 +10706,7 @@ "max": "", "min": "", "name": "mutator", + "size": "1", "type": "function", "unit": "-", "value": null @@ -10055,6 +10717,7 @@ "max": "1", "min": "0", "name": "p_cross", + "size": "1", "type": "float", "unit": "-", "value": 0.9 @@ -10065,6 +10728,7 @@ "max": "1", "min": "0", "name": "p_mutate", + "size": "1", "type": "float", "unit": "-", "value": 0.1 @@ -10075,6 +10739,7 @@ "max": "", "min": "1", "name": "size_pop", + "size": "1", "type": "int", "unit": "-", "value": 40 @@ -10085,6 +10750,7 @@ "max": "", "min": "1", "name": "nb_gen", + "size": "1", "type": "int", "unit": "-", "value": 100 @@ -10121,6 +10787,7 @@ "max": "", "min": "", "name": "toolbox", + "size": "", "type": "deap.base.Toolbox", "unit": "", "value": "None" @@ -10166,6 +10833,7 @@ "max": "", "min": "", "name": "simu", + "size": "1", "type": "Simulation", "unit": "", "value": "" @@ -10176,6 +10844,7 @@ "max": "", "min": "", "name": "design_var", + "size": "1", "type": "[OptiDesignVar]", "unit": "", "value": "" @@ -10186,6 +10855,7 @@ "max": "", "min": "", "name": "obj_func", + "size": "1", "type": "[OptiObjective]", "unit": "", "value": "" @@ -10196,6 +10866,7 @@ "max": "", "min": "", "name": "eval_func", + "size": "1", "type": "function", "unit": "", "value": null @@ -10206,6 +10877,7 @@ "max": "", "min": "", "name": "constraint", + "size": "1", "type": "[OptiConstraint]", "unit": "", "value": "" @@ -10216,6 +10888,7 @@ "max": "", "min": "", "name": "preprocessing", + "size": "", "type": "function", "unit": "", "value": null @@ -10226,6 +10899,7 @@ "max": "", "min": "", "name": "datakeeper_list", + "size": "1", "type": "[DataKeeper]", "unit": "", "value": "" @@ -10259,6 +10933,7 @@ "max": "", "min": "", "name": "problem", + "size": "1", "type": "OptiProblem", "unit": "-", "value": "" @@ -10269,6 +10944,7 @@ "max": "", "min": "", "name": "xoutput", + "size": "1", "type": "XOutput", "unit": "-", "value": "" @@ -10279,6 +10955,7 @@ "max": "", "min": "", "name": "logger_name", + "size": "0", "type": "str", "unit": "-", "value": "Pyleecan.OptiSolver" @@ -10289,6 +10966,7 @@ "max": "", "min": "", "name": "is_keep_all_output", + "size": "0", "type": "bool", "unit": "-", "value": false @@ -10324,6 +11002,7 @@ "max": "", "min": "", "name": "axes_dict", + "size": "", "type": "{SciDataTool.Classes.DataND.Data}", "unit": "", "value": "None" @@ -10334,6 +11013,7 @@ "max": "", "min": "", "name": "Is", + "size": "(qs, Nt_tot)", "type": "SciDataTool.Classes.DataND.DataND", "unit": "A", "value": "None" @@ -10344,6 +11024,7 @@ "max": "", "min": "", "name": "Ir", + "size": "(qs, Nt_tot)", "type": "SciDataTool.Classes.DataND.DataND", "unit": "A", "value": "None" @@ -10354,6 +11035,7 @@ "max": "", "min": "", "name": "logger_name", + "size": "0", "type": "str", "unit": "-", "value": "pyleecan.Electrical" @@ -10364,6 +11046,7 @@ "max": "", "min": "", "name": "Pj_losses", + "size": "", "type": "float", "unit": "W", "value": null @@ -10374,6 +11057,7 @@ "max": "", "min": "", "name": "Us", + "size": "(qs, Nt_tot)", "type": "SciDataTool.Classes.DataND.DataND", "unit": "V", "value": "None" @@ -10384,6 +11068,7 @@ "max": "", "min": "", "name": "internal", + "size": "0", "type": "OutInternal", "unit": "-", "value": null @@ -10394,6 +11079,7 @@ "max": "", "min": "", "name": "OP", + "size": "", "type": "OP", "unit": "-", "value": null @@ -10404,6 +11090,7 @@ "max": "", "min": "", "name": "Pem_av", + "size": "1", "type": "float", "unit": "W", "value": null @@ -10414,6 +11101,7 @@ "max": "", "min": "", "name": "Tem_av", + "size": "", "type": "float", "unit": "N.m", "value": null @@ -10424,6 +11112,7 @@ "max": "1", "min": "-1", "name": "phase_dir", + "size": "0", "type": "int", "unit": "", "value": null @@ -10434,6 +11123,7 @@ "max": "1", "min": "-1", "name": "current_dir", + "size": "0", "type": "int", "unit": "-", "value": null @@ -10444,6 +11134,7 @@ "max": "", "min": "", "name": "PWM", + "size": "", "type": "ImportGenPWM", "unit": "", "value": null @@ -10454,6 +11145,7 @@ "max": "", "min": "", "name": "eec", + "size": "", "type": "EEC", "unit": "", "value": null @@ -10464,6 +11156,7 @@ "max": "", "min": "", "name": "P_out", + "size": "1", "type": "float", "unit": "W", "value": null @@ -10474,6 +11167,7 @@ "max": "", "min": "0", "name": "Jrms", + "size": "", "type": "float", "unit": "A/m\u00c2\u00b2", "value": null @@ -10484,6 +11178,7 @@ "max": "", "min": "", "name": "P_in", + "size": "1", "type": "float", "unit": "W", "value": null @@ -10494,6 +11189,7 @@ "max": "", "min": "", "name": "Arms", + "size": "", "type": "float", "unit": "A/m", "value": null @@ -10504,6 +11200,7 @@ "max": "", "min": "", "name": "Erms", + "size": "", "type": "float", "unit": "V", "value": null @@ -10534,6 +11231,7 @@ "max": "", "min": "", "name": "axes_dict", + "size": "", "type": "{SciDataTool.Classes.DataND.Data}", "unit": "", "value": "None" @@ -10544,6 +11242,7 @@ "max": "", "min": "", "name": "AGSF", + "size": "(Nt_tot ,Na_tot)", "type": "SciDataTool.Classes.VectorField.VectorField", "unit": "N.m^2", "value": "None" @@ -10554,6 +11253,7 @@ "max": "", "min": "", "name": "logger_name", + "size": "0", "type": "str", "unit": "-", "value": "Pyleecan.Force" @@ -10564,6 +11264,7 @@ "max": "", "min": "", "name": "Rag", + "size": "0", "type": "float", "unit": "-", "value": null @@ -10574,6 +11275,7 @@ "max": "", "min": "", "name": "meshsolution", + "size": "", "type": "MeshSolution", "unit": "-", "value": null @@ -10602,6 +11304,7 @@ "max": "", "min": "", "name": "stator", + "size": "0", "type": "OutGeoLam", "unit": "-", "value": null @@ -10612,6 +11315,7 @@ "max": "", "min": "", "name": "rotor", + "size": "0", "type": "OutGeoLam", "unit": "-", "value": null @@ -10622,6 +11326,7 @@ "max": "", "min": "", "name": "Wgap_mec", + "size": "0", "type": "float", "unit": "m", "value": null @@ -10632,6 +11337,7 @@ "max": "", "min": "", "name": "Wgap_mag", + "size": "0", "type": "float", "unit": "m", "value": null @@ -10642,6 +11348,7 @@ "max": "", "min": "", "name": "Rgap_mec", + "size": "0", "type": "float", "unit": "m", "value": null @@ -10652,6 +11359,7 @@ "max": "", "min": "", "name": "Lgap", + "size": "0", "type": "float", "unit": "m", "value": null @@ -10662,6 +11370,7 @@ "max": "", "min": "", "name": "logger_name", + "size": "0", "type": "str", "unit": "-", "value": "Pyleecan.OutGeo" @@ -10672,6 +11381,7 @@ "max": "", "min": "", "name": "angle_rotor_initial", + "size": "0", "type": "float", "unit": "rad", "value": null @@ -10682,6 +11392,7 @@ "max": "1", "min": "-1", "name": "rot_dir", + "size": "", "type": "int", "unit": "-", "value": null @@ -10692,6 +11403,7 @@ "max": "", "min": "", "name": "per_a", + "size": "0", "type": "int", "unit": "-", "value": null @@ -10702,6 +11414,7 @@ "max": "", "min": "", "name": "is_antiper_a", + "size": "0", "type": "bool", "unit": "-", "value": null @@ -10712,6 +11425,7 @@ "max": "", "min": "", "name": "per_t_S", + "size": "0", "type": "int", "unit": "-", "value": null @@ -10722,6 +11436,7 @@ "max": "", "min": "", "name": "is_antiper_t_S", + "size": "0", "type": "bool", "unit": "-", "value": null @@ -10732,6 +11447,7 @@ "max": "", "min": "", "name": "axes_dict", + "size": "", "type": "{SciDataTool.Classes.DataND.Data}", "unit": "", "value": "None" @@ -10742,6 +11458,7 @@ "max": "", "min": "", "name": "per_t_R", + "size": "0", "type": "int", "unit": "-", "value": null @@ -10752,6 +11469,7 @@ "max": "", "min": "", "name": "is_antiper_t_R", + "size": "0", "type": "bool", "unit": "-", "value": null @@ -10780,6 +11498,7 @@ "max": "", "min": "", "name": "name_phase", + "size": "0", "type": "list", "unit": "-", "value": null @@ -10790,6 +11509,7 @@ "max": "", "min": "", "name": "BH_curve", + "size": "2", "type": "ndarray", "unit": "-", "value": null @@ -10800,6 +11520,7 @@ "max": "", "min": "", "name": "Ksfill", + "size": "0", "type": "float", "unit": "-", "value": null @@ -10810,6 +11531,7 @@ "max": "", "min": "", "name": "S_slot", + "size": "0", "type": "float", "unit": "m^2", "value": null @@ -10820,6 +11542,7 @@ "max": "", "min": "", "name": "S_slot_wind", + "size": "0", "type": "float", "unit": "m^2", "value": null @@ -10830,6 +11553,7 @@ "max": "", "min": "", "name": "S_wind_act", + "size": "0", "type": "float", "unit": "m^2", "value": null @@ -10840,6 +11564,7 @@ "max": "", "min": "", "name": "per_a", + "size": "0", "type": "int", "unit": "-", "value": null @@ -10850,6 +11575,7 @@ "max": "", "min": "", "name": "is_antiper_a", + "size": "0", "type": "bool", "unit": "-", "value": null @@ -10860,6 +11586,7 @@ "max": "", "min": "", "name": "per_t", + "size": "0", "type": "int", "unit": "-", "value": null @@ -10870,6 +11597,7 @@ "max": "", "min": "", "name": "is_antiper_t", + "size": "0", "type": "bool", "unit": "-", "value": null @@ -10925,6 +11653,7 @@ "max": "", "min": "", "name": "axes_dict", + "size": "", "type": "{SciDataTool.Classes.DataND.Data}", "unit": "", "value": "None" @@ -10935,6 +11664,7 @@ "max": "", "min": "", "name": "loss_dict", + "size": "", "type": "{OutLossModel}", "unit": "", "value": {} @@ -10945,6 +11675,7 @@ "max": "", "min": "", "name": "logger_name", + "size": "0", "type": "str", "unit": "-", "value": "Pyleecan.Loss" @@ -10981,6 +11712,7 @@ "max": "", "min": "", "name": "name", + "size": "", "type": "str", "unit": "", "value": "" @@ -10991,6 +11723,7 @@ "max": "", "min": "", "name": "loss_density", + "size": "", "type": "ndarray", "unit": "", "value": null @@ -11001,6 +11734,7 @@ "max": "", "min": "", "name": "coeff_dict", + "size": "", "type": "dict", "unit": "", "value": null @@ -11011,6 +11745,7 @@ "max": "", "min": "", "name": "group", + "size": "", "type": "str", "unit": "", "value": "None" @@ -11021,6 +11756,7 @@ "max": "", "min": "", "name": "loss_model", + "size": "", "type": "str", "unit": "", "value": "None" @@ -11031,6 +11767,7 @@ "max": "", "min": "", "name": "scalar_value", + "size": "", "type": "float", "unit": "", "value": null @@ -11066,6 +11803,7 @@ "max": "", "min": "", "name": "axes_dict", + "size": "", "type": "{SciDataTool.Classes.DataND.Data}", "unit": "", "value": "None" @@ -11076,6 +11814,7 @@ "max": "", "min": "", "name": "B", + "size": "(Nt_tot,Na_tot)", "type": "SciDataTool.Classes.VectorField.VectorField", "unit": "H", "value": "None" @@ -11086,6 +11825,7 @@ "max": "", "min": "", "name": "Tem", + "size": "Nt_tot", "type": "SciDataTool.Classes.DataND.DataND", "unit": "N.m", "value": "None" @@ -11096,6 +11836,7 @@ "max": "", "min": "", "name": "Tem_av", + "size": "", "type": "float", "unit": "N.m", "value": null @@ -11106,6 +11847,7 @@ "max": "", "min": "", "name": "Tem_rip_norm", + "size": "", "type": "float", "unit": "-", "value": null @@ -11116,6 +11858,7 @@ "max": "", "min": "", "name": "Tem_rip_pp", + "size": "", "type": "float", "unit": "N.m", "value": null @@ -11126,6 +11869,7 @@ "max": "", "min": "", "name": "Phi_wind_stator", + "size": "(Nt_tot, qs)", "type": "SciDataTool.Classes.DataND.DataND", "unit": "Wb", "value": "None" @@ -11136,6 +11880,7 @@ "max": "", "min": "", "name": "Phi_wind", + "size": "(Nt_tot, qs)", "type": "{SciDataTool.Classes.DataND.DataND}", "unit": "Wb", "value": "None" @@ -11146,6 +11891,7 @@ "max": "", "min": "", "name": "emf", + "size": "(Nt_tot, qs)", "type": "SciDataTool.Classes.DataND.DataND", "unit": "V", "value": "None" @@ -11156,6 +11902,7 @@ "max": "", "min": "", "name": "meshsolution", + "size": "", "type": "MeshSolution", "unit": "", "value": "" @@ -11166,6 +11913,7 @@ "max": "", "min": "", "name": "logger_name", + "size": "0", "type": "str", "unit": "-", "value": "Pyleecan.Magnetics" @@ -11176,6 +11924,7 @@ "max": "", "min": "", "name": "internal", + "size": "0", "type": "OutInternal", "unit": "-", "value": null @@ -11186,6 +11935,7 @@ "max": "", "min": "", "name": "Rag", + "size": "0", "type": "float", "unit": "-", "value": null @@ -11196,6 +11946,7 @@ "max": "", "min": "", "name": "Pem_av", + "size": "0", "type": "float", "unit": "W", "value": null @@ -11206,6 +11957,7 @@ "max": "", "min": "", "name": "Slice", + "size": "0", "type": "SliceModel", "unit": "-", "value": null @@ -11216,6 +11968,7 @@ "max": "", "min": "", "name": "Tem_slice", + "size": "(Nt_tot, Nslice)", "type": "SciDataTool.Classes.DataND.DataND", "unit": "N", "value": "None" @@ -11226,6 +11979,7 @@ "max": "", "min": "", "name": "Phi_wind_slice", + "size": "(Nt_tot, qs, Nslice)", "type": "{SciDataTool.Classes.DataND.DataND}", "unit": "Wb/m", "value": "None" @@ -11236,6 +11990,7 @@ "max": "", "min": "", "name": "Tem_norm", + "size": "", "type": "float", "unit": "N.m", "value": 0.001 @@ -11266,6 +12021,7 @@ "max": "", "min": "", "name": "FEA_dict", + "size": "", "type": "dict", "unit": "", "value": null @@ -11296,6 +12052,7 @@ "max": "", "min": "", "name": "FEMM_dict", + "size": "", "type": "dict", "unit": "", "value": null @@ -11306,6 +12063,7 @@ "max": "", "min": "", "name": "handler_list", + "size": "", "type": "[_FEMMHandler]", "unit": "", "value": "" @@ -11334,6 +12092,7 @@ "max": "", "min": "", "name": "legend_name", + "size": "", "type": "str", "unit": "-", "value": "" @@ -11344,6 +12103,7 @@ "max": "", "min": "", "name": "line_color", + "size": "", "type": "str", "unit": "-", "value": "" @@ -11372,6 +12132,7 @@ "max": "", "min": "", "name": "axes_dict", + "size": "", "type": "{SciDataTool.Classes.DataND.Data}", "unit": "", "value": "None" @@ -11382,6 +12143,7 @@ "max": "", "min": "", "name": "logger_name", + "size": "0", "type": "str", "unit": "-", "value": "Pyleecan.Structural" @@ -11392,6 +12154,7 @@ "max": "", "min": "", "name": "meshsolution", + "size": "", "type": "MeshSolution", "unit": "", "value": "" @@ -11402,6 +12165,7 @@ "max": "", "min": "", "name": "FEA_dict", + "size": "", "type": "dict", "unit": "", "value": null @@ -11448,6 +12212,7 @@ "max": "", "min": "", "name": "simu", + "size": "0", "type": "Simulation", "unit": "-", "value": "" @@ -11458,6 +12223,7 @@ "max": "", "min": "", "name": "path_result", + "size": "0", "type": "str", "unit": "-", "value": "" @@ -11468,6 +12234,7 @@ "max": "", "min": "", "name": "geo", + "size": "0", "type": "OutGeo", "unit": "-", "value": "" @@ -11478,6 +12245,7 @@ "max": "", "min": "", "name": "elec", + "size": "0", "type": "OutElec", "unit": "-", "value": "" @@ -11488,6 +12256,7 @@ "max": "", "min": "", "name": "mag", + "size": "0", "type": "OutMag", "unit": "-", "value": "" @@ -11498,6 +12267,7 @@ "max": "", "min": "", "name": "struct", + "size": "0", "type": "OutStruct", "unit": "-", "value": "" @@ -11508,6 +12278,7 @@ "max": "", "min": "", "name": "post", + "size": "0", "type": "OutPost", "unit": "-", "value": "" @@ -11518,6 +12289,7 @@ "max": "", "min": "", "name": "logger_name", + "size": "0", "type": "str", "unit": "-", "value": "Pyleecan.Output" @@ -11528,6 +12300,7 @@ "max": "", "min": "", "name": "force", + "size": "0", "type": "OutForce", "unit": "-", "value": "" @@ -11538,6 +12311,7 @@ "max": "", "min": "", "name": "loss", + "size": "0", "type": "OutLoss", "unit": "-", "value": "" @@ -11576,6 +12350,7 @@ "max": "", "min": "", "name": "name", + "size": "0", "type": "str", "unit": "-", "value": "" @@ -11586,6 +12361,7 @@ "max": "", "min": "", "name": "symbol", + "size": "", "type": "str", "unit": "-", "value": "" @@ -11596,6 +12372,7 @@ "max": "", "min": "", "name": "unit", + "size": "", "type": "str", "unit": "-", "value": "" @@ -11606,6 +12383,7 @@ "max": "", "min": "", "name": "setter", + "size": "", "type": "function", "unit": "-", "value": null @@ -11616,6 +12394,7 @@ "max": "", "min": "", "name": "getter", + "size": "", "type": "function", "unit": "-", "value": null @@ -11649,6 +12428,7 @@ "max": "", "min": "", "name": "min_value", + "size": "", "type": "float", "unit": "-", "value": 0 @@ -11659,6 +12439,7 @@ "max": "", "min": "", "name": "max_value", + "size": "", "type": "float", "unit": "-", "value": 1 @@ -11669,6 +12450,7 @@ "max": "", "min": "2", "name": "N", + "size": "", "type": "int", "unit": "-", "value": 4 @@ -11679,6 +12461,7 @@ "max": "1", "min": "0", "name": "type_value_gen", + "size": "", "type": "int", "unit": "-", "value": 0 @@ -11689,6 +12472,7 @@ "max": "1", "min": "0", "name": "type_value", + "size": "", "type": "int", "unit": "-", "value": 0 @@ -11722,6 +12506,7 @@ "max": "", "min": "", "name": "value", + "size": "", "type": "[]", "unit": "-", "value": "" @@ -11760,6 +12545,7 @@ "max": "", "min": "0", "name": "angle", + "size": "", "type": "float", "unit": "-", "value": 1 @@ -11770,6 +12556,7 @@ "max": "", "min": "0", "name": "height", + "size": "", "type": "float", "unit": "m", "value": 1 @@ -11820,6 +12607,7 @@ "max": "", "min": "", "name": "run", + "size": "", "type": "function", "unit": "", "value": null @@ -11850,6 +12638,7 @@ "max": "", "min": "", "name": "is_save_LUT", + "size": "", "type": "bool", "unit": "", "value": 1 @@ -11860,6 +12649,7 @@ "max": "", "min": "", "name": "file_name", + "size": "", "type": "str", "unit": "", "value": "LUT" @@ -11912,6 +12702,7 @@ "max": "", "min": "", "name": "method", + "size": "", "type": "str", "unit": "", "value": "None" @@ -11922,6 +12713,7 @@ "max": "", "min": "", "name": "name", + "size": "", "type": "str", "unit": "", "value": "[]" @@ -11932,6 +12724,7 @@ "max": "", "min": "", "name": "param_list", + "size": "", "type": "list", "unit": "", "value": [] @@ -11942,6 +12735,7 @@ "max": "", "min": "", "name": "param_dict", + "size": "", "type": "dict", "unit": "", "value": {} @@ -11952,6 +12746,7 @@ "max": "", "min": "", "name": "save_format", + "size": "", "type": "str", "unit": "", "value": "png" @@ -11962,6 +12757,7 @@ "max": "", "min": "", "name": "quantity", + "size": "", "type": "str", "unit": "", "value": "None" @@ -11999,6 +12795,7 @@ "max": "", "min": "0.00E+00", "name": "epsilon", + "size": "0", "type": "float", "unit": "-", "value": 0.05 @@ -12223,6 +13020,7 @@ "max": "", "min": "", "name": "section", + "size": "", "type": "str", "unit": "", "value": "" @@ -12233,6 +13031,7 @@ "max": "", "min": "", "name": "id", + "size": "", "type": "int", "unit": "", "value": null @@ -12243,6 +13042,7 @@ "max": "", "min": "", "name": "comment", + "size": "", "type": "str", "unit": "", "value": "" @@ -12253,6 +13053,7 @@ "max": "", "min": "", "name": "_statements", + "size": "", "type": "dict", "unit": "", "value": "" @@ -12263,6 +13064,7 @@ "max": "", "min": "", "name": "_comments", + "size": "", "type": "dict", "unit": "", "value": "" @@ -12312,6 +13114,7 @@ "max": "", "min": "", "name": "begin", + "size": "0", "type": "complex", "unit": "-", "value": 0 @@ -12322,6 +13125,7 @@ "max": "", "min": "", "name": "end", + "size": "0", "type": "complex", "unit": "-", "value": 0 @@ -12354,6 +13158,7 @@ "max": "", "min": "0", "name": "Lshaft", + "size": "0", "type": "float", "unit": "m", "value": 0.442 @@ -12364,6 +13169,7 @@ "max": "", "min": "", "name": "mat_type", + "size": "0", "type": "Material", "unit": "", "value": "" @@ -12374,6 +13180,7 @@ "max": "", "min": "0", "name": "Drsh", + "size": "0", "type": "float", "unit": "m", "value": 0.045 @@ -12404,6 +13211,7 @@ "max": "", "min": "", "name": "elec", + "size": "0", "type": "Electrical", "unit": "-", "value": null @@ -12414,6 +13222,7 @@ "max": "", "min": "", "name": "mag", + "size": "0", "type": "Magnetics", "unit": "-", "value": null @@ -12424,6 +13233,7 @@ "max": "", "min": "", "name": "struct", + "size": "0", "type": "Structural", "unit": "-", "value": null @@ -12434,6 +13244,7 @@ "max": "", "min": "", "name": "force", + "size": "0", "type": "Force", "unit": "-", "value": null @@ -12444,6 +13255,7 @@ "max": "", "min": "", "name": "loss", + "size": "0", "type": "Loss", "unit": "-", "value": null @@ -12479,6 +13291,7 @@ "max": "", "min": "", "name": "name", + "size": "0", "type": "str", "unit": "-", "value": "" @@ -12489,6 +13302,7 @@ "max": "", "min": "", "name": "desc", + "size": "0", "type": "str", "unit": "-", "value": "" @@ -12499,6 +13313,7 @@ "max": "", "min": "", "name": "machine", + "size": "0", "type": "Machine", "unit": "-", "value": "" @@ -12509,6 +13324,7 @@ "max": "", "min": "", "name": "input", + "size": "0", "type": "Input", "unit": "-", "value": "" @@ -12519,6 +13335,7 @@ "max": "", "min": "", "name": "logger_name", + "size": "0", "type": "str", "unit": "-", "value": "Pyleecan.Simulation" @@ -12529,6 +13346,7 @@ "max": "", "min": "", "name": "var_simu", + "size": "", "type": "VarSimu", "unit": "-", "value": null @@ -12539,6 +13357,7 @@ "max": "", "min": "", "name": "postproc_list", + "size": "0", "type": "[Post]", "unit": "-", "value": [] @@ -12549,6 +13368,7 @@ "max": "", "min": "0", "name": "index", + "size": "0", "type": "int", "unit": "-", "value": null @@ -12559,6 +13379,7 @@ "max": "", "min": "", "name": "path_result", + "size": "", "type": "str", "unit": "-", "value": "None" @@ -12569,6 +13390,7 @@ "max": "", "min": "0", "name": "layer", + "size": "", "type": "int", "unit": "-", "value": null @@ -12579,6 +13401,7 @@ "max": "", "min": "0", "name": "layer_log_warn", + "size": "", "type": "int", "unit": "-", "value": null @@ -12611,6 +13434,7 @@ "max": "", "min": "", "name": "type_skew", + "size": "0", "type": "str", "unit": "-", "value": "None" @@ -12621,6 +13445,7 @@ "max": "", "min": "", "name": "rate", + "size": "0", "type": "float", "unit": "-", "value": 1 @@ -12631,6 +13456,7 @@ "max": "", "min": "", "name": "is_step", + "size": "0", "type": "bool", "unit": "-", "value": true @@ -12641,6 +13467,7 @@ "max": "", "min": "", "name": "function", + "size": "0", "type": "function", "unit": "-", "value": null @@ -12651,6 +13478,7 @@ "max": "", "min": "", "name": "angle_list", + "size": "1", "type": "list", "unit": "rad", "value": null @@ -12661,6 +13489,7 @@ "max": "", "min": "", "name": "z_list", + "size": "1", "type": "list", "unit": "m", "value": null @@ -12671,6 +13500,7 @@ "max": "", "min": "2", "name": "Nstep", + "size": "", "type": "int", "unit": "", "value": null @@ -12681,6 +13511,7 @@ "max": "", "min": "0", "name": "angle_overall", + "size": "", "type": "float", "unit": "rad", "value": null @@ -12713,6 +13544,7 @@ "max": "", "min": "", "name": "type_distribution", + "size": "", "type": "str", "unit": "-", "value": "None" @@ -12723,6 +13555,7 @@ "max": "", "min": "", "name": "Nslices", + "size": "", "type": "int", "unit": "-", "value": 5 @@ -12733,6 +13566,7 @@ "max": "", "min": "", "name": "z_list", + "size": "", "type": "list", "unit": "m", "value": null @@ -12743,6 +13577,7 @@ "max": "", "min": "", "name": "angle_rotor", + "size": "", "type": "ndarray", "unit": "rad", "value": null @@ -12753,6 +13588,7 @@ "max": "", "min": "", "name": "angle_stator", + "size": "", "type": "ndarray", "unit": "rad", "value": null @@ -12763,6 +13599,7 @@ "max": "", "min": "", "name": "L", + "size": "", "type": "float", "unit": "m", "value": null @@ -12773,6 +13610,7 @@ "max": "", "min": "", "name": "is_step", + "size": "0", "type": "bool", "unit": "-", "value": null @@ -12783,6 +13621,7 @@ "max": "", "min": "", "name": "is_skew", + "size": "", "type": "bool", "unit": "", "value": null @@ -12877,6 +13716,7 @@ "max": "", "min": "0", "name": "Zs", + "size": "0", "type": "int", "unit": "-", "value": 36 @@ -12887,6 +13727,7 @@ "max": "", "min": "", "name": "wedge_mat", + "size": "0", "type": "Material", "unit": "-", "value": null @@ -12897,6 +13738,7 @@ "max": "", "min": "", "name": "is_bore", + "size": "0", "type": "bool", "unit": "-", "value": 1 @@ -12937,6 +13779,7 @@ "max": "", "min": "0", "name": "W0", + "size": "0", "type": "float", "unit": "m", "value": 0.013 @@ -12947,6 +13790,7 @@ "max": "", "min": "0", "name": "H0", + "size": "0", "type": "float", "unit": "m", "value": 0.02 @@ -12957,6 +13801,7 @@ "max": "", "min": "0", "name": "W1", + "size": "0", "type": "float", "unit": "m", "value": 0.01 @@ -12967,6 +13812,7 @@ "max": "", "min": "", "name": "Wx_is_rad", + "size": "0", "type": "bool", "unit": "-", "value": 0 @@ -13015,6 +13861,7 @@ "max": "", "min": "0", "name": "W0", + "size": "0", "type": "float", "unit": "m", "value": 0.01 @@ -13025,6 +13872,7 @@ "max": "", "min": "0", "name": "H0", + "size": "0", "type": "float", "unit": "m", "value": 0.03 @@ -13035,6 +13883,7 @@ "max": "", "min": "", "name": "is_H0_bore", + "size": "0", "type": "bool", "unit": "-", "value": 1 @@ -13077,6 +13926,7 @@ "max": "", "min": "0", "name": "W1", + "size": "0", "type": "float", "unit": "m", "value": 0.0122 @@ -13087,6 +13937,7 @@ "max": "", "min": "0", "name": "H1", + "size": "0", "type": "float", "unit": "m", "value": 0.0122 @@ -13097,6 +13948,7 @@ "max": "", "min": "0", "name": "D1", + "size": "0", "type": "float", "unit": "m", "value": 0.001 @@ -13107,6 +13959,7 @@ "max": "", "min": "0", "name": "W2", + "size": "0", "type": "float", "unit": "m", "value": 0.0122 @@ -13117,6 +13970,7 @@ "max": "", "min": "0", "name": "H2", + "size": "0", "type": "float", "unit": "m", "value": 0.001 @@ -13127,6 +13981,7 @@ "max": "", "min": "0", "name": "D2", + "size": "0", "type": "float", "unit": "m", "value": 0.001 @@ -13137,6 +13992,7 @@ "max": "", "min": "0", "name": "H3", + "size": "0", "type": "float", "unit": "m", "value": 0.001 @@ -13147,6 +14003,7 @@ "max": "", "min": "0", "name": "R3", + "size": "0", "type": "float", "unit": "m", "value": 0.001 @@ -13191,6 +14048,7 @@ "max": "", "min": "0", "name": "W0", + "size": "0", "type": "float", "unit": "m", "value": 0 @@ -13201,6 +14059,7 @@ "max": "", "min": "0", "name": "H0", + "size": "0", "type": "float", "unit": "m", "value": 0 @@ -13211,6 +14070,7 @@ "max": "", "min": "0", "name": "W1", + "size": "0", "type": "float", "unit": "m", "value": 0 @@ -13221,6 +14081,7 @@ "max": "", "min": "0", "name": "H1", + "size": "0", "type": "float", "unit": "m", "value": 0 @@ -13266,6 +14127,7 @@ "max": "", "min": "0", "name": "W0", + "size": "0", "type": "float", "unit": "rad", "value": 0 @@ -13276,6 +14138,7 @@ "max": "", "min": "0", "name": "H0", + "size": "0", "type": "float", "unit": "m", "value": 0 @@ -13286,6 +14149,7 @@ "max": "", "min": "0", "name": "W1", + "size": "0", "type": "float", "unit": "rad", "value": 0 @@ -13296,6 +14160,7 @@ "max": "", "min": "0", "name": "H1", + "size": "0", "type": "float", "unit": "m", "value": 0 @@ -13340,6 +14205,7 @@ "max": "", "min": "0", "name": "W0", + "size": "0", "type": "float", "unit": "m", "value": 0.0122 @@ -13350,6 +14216,7 @@ "max": "", "min": "0", "name": "H0", + "size": "0", "type": "float", "unit": "m", "value": 0.001 @@ -13360,6 +14227,7 @@ "max": "", "min": "0", "name": "W1", + "size": "0", "type": "float", "unit": "m", "value": 0.0122 @@ -13370,6 +14238,7 @@ "max": "", "min": "0", "name": "H1", + "size": "0", "type": "float", "unit": "m", "value": 0.001 @@ -13414,6 +14283,7 @@ "max": "", "min": "0", "name": "W0", + "size": "0", "type": "float", "unit": "m", "value": 0.0122 @@ -13424,6 +14294,7 @@ "max": "", "min": "0", "name": "H0", + "size": "0", "type": "float", "unit": "m", "value": 0.001 @@ -13434,6 +14305,7 @@ "max": "", "min": "0", "name": "W1", + "size": "0", "type": "float", "unit": "m", "value": 0.0122 @@ -13444,6 +14316,7 @@ "max": "", "min": "0", "name": "H1", + "size": "0", "type": "float", "unit": "m", "value": 0.001 @@ -13454,6 +14327,7 @@ "max": "", "min": "0", "name": "Rtopm", + "size": "0", "type": "float", "unit": "m", "value": 0.001 @@ -13499,6 +14373,7 @@ "max": "", "min": "0", "name": "W0", + "size": "0", "type": "float", "unit": "rad", "value": 0.0122 @@ -13509,6 +14384,7 @@ "max": "", "min": "0", "name": "H0", + "size": "0", "type": "float", "unit": "m", "value": 0.001 @@ -13519,6 +14395,7 @@ "max": "", "min": "0", "name": "W1", + "size": "0", "type": "float", "unit": "rad", "value": 0.0122 @@ -13529,6 +14406,7 @@ "max": "", "min": "0", "name": "H1", + "size": "0", "type": "float", "unit": "m", "value": 0.001 @@ -13539,6 +14417,7 @@ "max": "", "min": "0", "name": "Rtopm", + "size": "0", "type": "float", "unit": "m", "value": 0.001 @@ -13583,6 +14462,7 @@ "max": "", "min": "0", "name": "W0", + "size": "0", "type": "float", "unit": "rad", "value": 0.0122 @@ -13593,6 +14473,7 @@ "max": "", "min": "0", "name": "H0", + "size": "0", "type": "float", "unit": "m", "value": 0.001 @@ -13603,6 +14484,7 @@ "max": "", "min": "0", "name": "W1", + "size": "0", "type": "float", "unit": "m", "value": 0.0122 @@ -13613,6 +14495,7 @@ "max": "", "min": "0", "name": "H1", + "size": "0", "type": "float", "unit": "m", "value": 0.001 @@ -13623,6 +14506,7 @@ "max": "", "min": "0", "name": "Rtopm", + "size": "0", "type": "float", "unit": "m", "value": 0.001 @@ -13666,6 +14550,7 @@ "max": "", "min": "0", "name": "W0", + "size": "0", "type": "float", "unit": "m", "value": 0.0122 @@ -13676,6 +14561,7 @@ "max": "", "min": "0", "name": "H0", + "size": "0", "type": "float", "unit": "m", "value": 0.001 @@ -13686,6 +14572,7 @@ "max": "", "min": "0", "name": "W1", + "size": "0", "type": "float", "unit": "m", "value": 0.0122 @@ -13696,6 +14583,7 @@ "max": "", "min": "0", "name": "H1", + "size": "0", "type": "float", "unit": "m", "value": 0.001 @@ -13774,6 +14662,7 @@ "max": "", "min": "0", "name": "H0", + "size": "0", "type": "float", "unit": "m", "value": 0.001 @@ -13820,6 +14709,7 @@ "max": "", "min": "0", "name": "H0_bore", + "size": "0", "type": "float", "unit": "m", "value": 0.001 @@ -13830,6 +14720,7 @@ "max": "", "min": "0", "name": "H0_gap", + "size": "0", "type": "float", "unit": "m", "value": 0.001 @@ -13873,6 +14764,7 @@ "max": "", "min": "0", "name": "W0", + "size": "0", "type": "float", "unit": "m", "value": 0 @@ -13883,6 +14775,7 @@ "max": "", "min": "0", "name": "W1", + "size": "0", "type": "float", "unit": "m", "value": 0 @@ -13893,6 +14786,7 @@ "max": "", "min": "0", "name": "H0", + "size": "0", "type": "float", "unit": "m", "value": 0 @@ -13927,6 +14821,7 @@ "max": "", "min": "", "name": "line_list", + "size": "", "type": "[Line]", "unit": "-", "value": "" @@ -13937,6 +14832,7 @@ "max": "", "min": "", "name": "wind_begin_index", + "size": "", "type": "int", "unit": "-", "value": null @@ -13947,6 +14843,7 @@ "max": "", "min": "", "name": "wind_end_index", + "size": "", "type": "int", "unit": "-", "value": null @@ -13957,6 +14854,7 @@ "max": "1", "min": "0", "name": "type_line_wind", + "size": "", "type": "int", "unit": "-", "value": 0 @@ -13967,6 +14865,7 @@ "max": "", "min": "", "name": "name", + "size": "", "type": "str", "unit": "-", "value": "" @@ -14001,6 +14900,7 @@ "max": "", "min": "", "name": "line_list", + "size": "", "type": "[Line]", "unit": "-", "value": "" @@ -14011,6 +14911,7 @@ "max": "", "min": "", "name": "active_surf", + "size": "", "type": "Surface", "unit": "-", "value": "" @@ -14021,6 +14922,7 @@ "max": "", "min": "", "name": "split_active_surf_dict", + "size": "", "type": "dict", "unit": "-", "value": null @@ -14031,6 +14933,7 @@ "max": "", "min": "", "name": "name", + "size": "", "type": "str", "unit": "-", "value": "" @@ -14079,6 +14982,7 @@ "max": "", "min": "0", "name": "W0", + "size": "0", "type": "float", "unit": "m", "value": 0.0122 @@ -14089,6 +14993,7 @@ "max": "", "min": "0", "name": "H0", + "size": "0", "type": "float", "unit": "m", "value": 0.001 @@ -14099,6 +15004,7 @@ "max": "", "min": "0", "name": "H1", + "size": "0", "type": "float", "unit": "m/rad", "value": 0.0015 @@ -14109,6 +15015,7 @@ "max": "", "min": "0", "name": "W1", + "size": "0", "type": "float", "unit": "m", "value": 0.014 @@ -14119,6 +15026,7 @@ "max": "", "min": "0", "name": "H2", + "size": "0", "type": "float", "unit": "m", "value": 0.0325 @@ -14129,6 +15037,7 @@ "max": "", "min": "0", "name": "W2", + "size": "0", "type": "float", "unit": "m", "value": 0.0122 @@ -14139,6 +15048,7 @@ "max": "", "min": "", "name": "H1_is_rad", + "size": "0", "type": "bool", "unit": "", "value": 0 @@ -14189,6 +15099,7 @@ "max": "", "min": "0", "name": "W0", + "size": "0", "type": "float", "unit": "m", "value": null @@ -14199,6 +15110,7 @@ "max": "", "min": "0", "name": "H0", + "size": "0", "type": "float", "unit": "m", "value": null @@ -14209,6 +15121,7 @@ "max": "", "min": "0", "name": "H1", + "size": "0", "type": "float", "unit": "m/rad", "value": null @@ -14219,6 +15132,7 @@ "max": "", "min": "", "name": "H1_is_rad", + "size": "0", "type": "bool", "unit": "", "value": 0 @@ -14229,6 +15143,7 @@ "max": "", "min": "0", "name": "W1", + "size": "0", "type": "float", "unit": "m", "value": null @@ -14239,6 +15154,7 @@ "max": "", "min": "0", "name": "H2", + "size": "0", "type": "float", "unit": "m", "value": null @@ -14249,6 +15165,7 @@ "max": "", "min": "0", "name": "W2", + "size": "0", "type": "float", "unit": "m", "value": null @@ -14259,6 +15176,7 @@ "max": "", "min": "", "name": "is_cstt_tooth", + "size": "0", "type": "bool", "unit": "-", "value": 0 @@ -14269,6 +15187,7 @@ "max": "", "min": "0", "name": "W3", + "size": "0", "type": "float", "unit": "m", "value": null @@ -14279,6 +15198,7 @@ "max": "", "min": "0", "name": "R1", + "size": "0", "type": "float", "unit": "m", "value": null @@ -14325,6 +15245,7 @@ "max": "", "min": "0", "name": "H0", + "size": "0", "type": "float", "unit": "m", "value": 0.003 @@ -14335,6 +15256,7 @@ "max": "", "min": "0", "name": "H1", + "size": "0", "type": "float", "unit": "m/rad", "value": 0 @@ -14345,6 +15267,7 @@ "max": "", "min": "0", "name": "R1", + "size": "0", "type": "float", "unit": "m", "value": 0.001 @@ -14355,6 +15278,7 @@ "max": "", "min": "0", "name": "R2", + "size": "0", "type": "float", "unit": "m", "value": 0.001 @@ -14403,6 +15327,7 @@ "max": "", "min": "0", "name": "W0", + "size": "0", "type": "float", "unit": "m", "value": 0.0122 @@ -14413,6 +15338,7 @@ "max": "", "min": "0", "name": "H0", + "size": "0", "type": "float", "unit": "m", "value": 0.001 @@ -14423,6 +15349,7 @@ "max": "", "min": "0", "name": "H1", + "size": "0", "type": "float", "unit": "m/rad", "value": 0.0015 @@ -14433,6 +15360,7 @@ "max": "", "min": "0", "name": "W1", + "size": "0", "type": "float", "unit": "m", "value": 0.014 @@ -14443,6 +15371,7 @@ "max": "", "min": "0", "name": "H2", + "size": "0", "type": "float", "unit": "m", "value": 0.0325 @@ -14453,6 +15382,7 @@ "max": "", "min": "0", "name": "W2", + "size": "0", "type": "float", "unit": "m", "value": 0.0122 @@ -14463,6 +15393,7 @@ "max": "", "min": "0", "name": "W3", + "size": "0", "type": "float", "unit": "m", "value": 0.0122 @@ -14473,6 +15404,7 @@ "max": "", "min": "", "name": "H1_is_rad", + "size": "0", "type": "bool", "unit": "", "value": 0 @@ -14521,6 +15453,7 @@ "max": "", "min": "0", "name": "W0", + "size": "0", "type": "float", "unit": "m", "value": 0.0122 @@ -14531,6 +15464,7 @@ "max": "", "min": "0", "name": "H0", + "size": "0", "type": "float", "unit": "m", "value": 0.001 @@ -14541,6 +15475,7 @@ "max": "", "min": "0", "name": "H1", + "size": "0", "type": "float", "unit": "m", "value": 0.0015 @@ -14551,6 +15486,7 @@ "max": "", "min": "0", "name": "H3", + "size": "0", "type": "float", "unit": "m", "value": 0.0122 @@ -14561,6 +15497,7 @@ "max": "", "min": "0", "name": "wedge_type", + "size": "0", "type": "int", "unit": "-", "value": 0.0 @@ -14571,6 +15508,7 @@ "max": "", "min": "0", "name": "W3", + "size": "0", "type": "float", "unit": "m", "value": 0.0122 @@ -14616,6 +15554,7 @@ "max": "", "min": "0", "name": "W0", + "size": "0", "type": "float", "unit": "m", "value": 0.0122 @@ -14626,6 +15565,7 @@ "max": "", "min": "0", "name": "W3", + "size": "0", "type": "float", "unit": "m", "value": 0.0122 @@ -14636,6 +15576,7 @@ "max": "", "min": "0", "name": "H0", + "size": "0", "type": "float", "unit": "m", "value": 0.001 @@ -14646,6 +15587,7 @@ "max": "", "min": "0", "name": "H1", + "size": "0", "type": "float", "unit": "m", "value": 0.0015 @@ -14656,6 +15598,7 @@ "max": "", "min": "0", "name": "H2", + "size": "0", "type": "float", "unit": "m", "value": 0.0122 @@ -14666,6 +15609,7 @@ "max": "", "min": "0", "name": "R1", + "size": "0", "type": "float", "unit": "m", "value": 0.001 @@ -14676,6 +15620,7 @@ "max": "", "min": "0", "name": "R2", + "size": "0", "type": "float", "unit": "m", "value": 0.001 @@ -14721,6 +15666,7 @@ "max": "", "min": "0", "name": "W0", + "size": "0", "type": "float", "unit": "rad", "value": 0.0122 @@ -14731,6 +15677,7 @@ "max": "", "min": "0", "name": "W3", + "size": "0", "type": "float", "unit": "m", "value": 0.0122 @@ -14741,6 +15688,7 @@ "max": "", "min": "0", "name": "H0", + "size": "0", "type": "float", "unit": "m", "value": 0.001 @@ -14751,6 +15699,7 @@ "max": "", "min": "0", "name": "H2", + "size": "0", "type": "float", "unit": "m", "value": 0.0122 @@ -14761,6 +15710,7 @@ "max": "", "min": "0", "name": "R1", + "size": "0", "type": "float", "unit": "m", "value": 0.001 @@ -14809,6 +15759,7 @@ "max": "", "min": "0", "name": "W0", + "size": "0", "type": "float", "unit": "m", "value": 0.003 @@ -14819,6 +15770,7 @@ "max": "", "min": "0", "name": "H0", + "size": "0", "type": "float", "unit": "m", "value": 0.003 @@ -14829,6 +15781,7 @@ "max": "", "min": "0", "name": "H1", + "size": "0", "type": "float", "unit": "m/rad", "value": 0 @@ -14839,6 +15792,7 @@ "max": "", "min": "", "name": "H1_is_rad", + "size": "0", "type": "bool", "unit": "", "value": 0 @@ -14849,6 +15803,7 @@ "max": "", "min": "0", "name": "W1", + "size": "0", "type": "float", "unit": "m", "value": 0.013 @@ -14859,6 +15814,7 @@ "max": "", "min": "0", "name": "H2", + "size": "0", "type": "float", "unit": "m", "value": 0.02 @@ -14869,6 +15825,7 @@ "max": "", "min": "0", "name": "W2", + "size": "0", "type": "float", "unit": "m", "value": 0.01 @@ -14916,6 +15873,7 @@ "max": "", "min": "0", "name": "W0", + "size": "0", "type": "float", "unit": "rad", "value": 0.043633 @@ -14926,6 +15884,7 @@ "max": "", "min": "0", "name": "H0", + "size": "0", "type": "float", "unit": "m", "value": 0.006 @@ -14936,6 +15895,7 @@ "max": "", "min": "0", "name": "H2", + "size": "0", "type": "float", "unit": "m", "value": 0.04 @@ -14946,6 +15906,7 @@ "max": "", "min": "0", "name": "W2", + "size": "0", "type": "float", "unit": "rad", "value": 0.08725 @@ -14996,6 +15957,7 @@ "max": "", "min": "0", "name": "W0", + "size": "0", "type": "float", "unit": "m", "value": null @@ -15006,6 +15968,7 @@ "max": "", "min": "0", "name": "H0", + "size": "0", "type": "float", "unit": "m", "value": null @@ -15016,6 +15979,7 @@ "max": "", "min": "0", "name": "H1", + "size": "0", "type": "float", "unit": "m/rad", "value": null @@ -15026,6 +15990,7 @@ "max": "", "min": "0", "name": "W1", + "size": "0", "type": "float", "unit": "m", "value": null @@ -15036,6 +16001,7 @@ "max": "", "min": "0", "name": "H2", + "size": "0", "type": "float", "unit": "m", "value": null @@ -15046,6 +16012,7 @@ "max": "", "min": "0", "name": "W2", + "size": "0", "type": "float", "unit": "m", "value": null @@ -15056,6 +16023,7 @@ "max": "", "min": "", "name": "H1_is_rad", + "size": "0", "type": "bool", "unit": "-", "value": 0 @@ -15066,6 +16034,7 @@ "max": "", "min": "", "name": "is_cstt_tooth", + "size": "0", "type": "bool", "unit": "-", "value": 0 @@ -15076,6 +16045,7 @@ "max": "", "min": "0", "name": "W3", + "size": "0", "type": "float", "unit": "m", "value": null @@ -15123,6 +16093,7 @@ "max": "", "min": "0", "name": "W3", + "size": "0", "type": "float", "unit": "m", "value": 0.003 @@ -15133,6 +16104,7 @@ "max": "", "min": "0", "name": "H2", + "size": "0", "type": "float", "unit": "m", "value": 0.003 @@ -15180,6 +16152,7 @@ "max": "", "min": "0", "name": "W3", + "size": "0", "type": "float", "unit": "m", "value": 0.003 @@ -15190,6 +16163,7 @@ "max": "", "min": "0", "name": "H2", + "size": "0", "type": "float", "unit": "m", "value": 0.003 @@ -15200,6 +16174,7 @@ "max": "", "min": "0", "name": "W4", + "size": "0", "type": "float", "unit": "m", "value": 0.003 @@ -15210,6 +16185,7 @@ "max": "", "min": "0", "name": "H1", + "size": "0", "type": "float", "unit": "m", "value": 0.003 @@ -15256,6 +16232,7 @@ "max": "", "min": "0", "name": "W0", + "size": "0", "type": "float", "unit": "m", "value": 0.0122 @@ -15266,6 +16243,7 @@ "max": "", "min": "0", "name": "H0", + "size": "0", "type": "float", "unit": "m", "value": 0.001 @@ -15276,6 +16254,7 @@ "max": "", "min": "0", "name": "H1", + "size": "0", "type": "float", "unit": "m", "value": 0.003 @@ -15286,6 +16265,7 @@ "max": "", "min": "0", "name": "R1", + "size": "0", "type": "float", "unit": "m", "value": 0.003 @@ -15296,6 +16276,7 @@ "max": "", "min": "0", "name": "R2", + "size": "0", "type": "float", "unit": "m", "value": 0.003 @@ -15342,6 +16323,7 @@ "max": "", "min": "0", "name": "H0", + "size": "0", "type": "float", "unit": "m", "value": 0.003 @@ -15352,6 +16334,7 @@ "max": "", "min": "0", "name": "H1", + "size": "0", "type": "float", "unit": "m", "value": 0 @@ -15362,6 +16345,7 @@ "max": "", "min": "0", "name": "H2", + "size": "0", "type": "float", "unit": "m", "value": 0.02 @@ -15372,6 +16356,7 @@ "max": "", "min": "0", "name": "W0", + "size": "0", "type": "float", "unit": "m", "value": 0.003 @@ -15382,6 +16367,7 @@ "max": "", "min": "0", "name": "W1", + "size": "0", "type": "float", "unit": "m", "value": 0.013 @@ -15392,6 +16378,7 @@ "max": "", "min": "0", "name": "W2", + "size": "0", "type": "float", "unit": "m", "value": 0.01 @@ -15402,6 +16389,7 @@ "max": "", "min": "0", "name": "W3", + "size": "0", "type": "float", "unit": "m", "value": 0.003 @@ -15412,6 +16400,7 @@ "max": "", "min": "", "name": "is_trap_wind", + "size": "0", "type": "bool", "unit": "-", "value": 0 @@ -15457,6 +16446,7 @@ "max": "", "min": "0", "name": "W0", + "size": "0", "type": "float", "unit": "m", "value": 0.0122 @@ -15467,6 +16457,7 @@ "max": "", "min": "0", "name": "H0", + "size": "0", "type": "float", "unit": "m", "value": 0.001 @@ -15477,6 +16468,7 @@ "max": "", "min": "0", "name": "R1", + "size": "0", "type": "float", "unit": "m", "value": 0.003 @@ -15487,6 +16479,7 @@ "max": "", "min": "0", "name": "W3", + "size": "0", "type": "float", "unit": "m", "value": 0.005 @@ -15497,6 +16490,7 @@ "max": "", "min": "0", "name": "H3", + "size": "0", "type": "float", "unit": "m", "value": 0.003 @@ -15546,6 +16540,7 @@ "max": "", "min": "0", "name": "W0", + "size": "0", "type": "float", "unit": "m", "value": 0.05 @@ -15556,6 +16551,7 @@ "max": "", "min": "0", "name": "H0", + "size": "0", "type": "float", "unit": "m", "value": 0.001 @@ -15566,6 +16562,7 @@ "max": "", "min": "0", "name": "H1", + "size": "0", "type": "float", "unit": "m", "value": 0.0015 @@ -15576,6 +16573,7 @@ "max": "", "min": "0", "name": "W1", + "size": "0", "type": "float", "unit": "m", "value": 0.015 @@ -15586,6 +16584,7 @@ "max": "", "min": "0", "name": "wedge_type", + "size": "0", "type": "int", "unit": "-", "value": 0.0 @@ -15596,6 +16595,7 @@ "max": "", "min": "0", "name": "H2", + "size": "0", "type": "float", "unit": "m", "value": 0.03 @@ -15606,6 +16606,7 @@ "max": "", "min": "0", "name": "W2", + "size": "0", "type": "float", "unit": "m", "value": 0.2 @@ -15652,6 +16653,7 @@ "max": "", "min": "0", "name": "W1", + "size": "0", "type": "float", "unit": "m", "value": 0.02 @@ -15662,6 +16664,7 @@ "max": "", "min": "0", "name": "W2", + "size": "0", "type": "float", "unit": "m", "value": 0.03 @@ -15672,6 +16675,7 @@ "max": "", "min": "0", "name": "H1", + "size": "0", "type": "float", "unit": "m", "value": 0.05 @@ -15682,6 +16686,7 @@ "max": "", "min": "0", "name": "H2", + "size": "0", "type": "float", "unit": "m", "value": 0.15 @@ -15692,6 +16697,7 @@ "max": "", "min": "0", "name": "R1", + "size": "0", "type": "float", "unit": "m", "value": 0.03 @@ -15702,6 +16708,7 @@ "max": "", "min": "0", "name": "H3", + "size": "0", "type": "float", "unit": "m", "value": 0 @@ -15712,6 +16719,7 @@ "max": "", "min": "0", "name": "H4", + "size": "0", "type": "float", "unit": "m", "value": 0 @@ -15722,6 +16730,7 @@ "max": "", "min": "0", "name": "W3", + "size": "0", "type": "float", "unit": "m", "value": 0 @@ -15768,6 +16777,7 @@ "max": "", "min": "0", "name": "W0", + "size": "0", "type": "float", "unit": "m", "value": 0.314 @@ -15778,6 +16788,7 @@ "max": "", "min": "0", "name": "W1", + "size": "0", "type": "float", "unit": "m", "value": 0.02 @@ -15788,6 +16799,7 @@ "max": "", "min": "0", "name": "W2", + "size": "0", "type": "float", "unit": "m", "value": 0.03 @@ -15798,6 +16810,7 @@ "max": "", "min": "0", "name": "H0", + "size": "0", "type": "float", "unit": "m", "value": 0.003 @@ -15808,6 +16821,7 @@ "max": "", "min": "0", "name": "H1", + "size": "0", "type": "float", "unit": "m", "value": 0.05 @@ -15818,6 +16832,7 @@ "max": "", "min": "0", "name": "H2", + "size": "0", "type": "float", "unit": "m", "value": 0.15 @@ -15828,6 +16843,7 @@ "max": "", "min": "0", "name": "H3", + "size": "0", "type": "float", "unit": "m", "value": 0 @@ -15838,6 +16854,7 @@ "max": "", "min": "0", "name": "H4", + "size": "0", "type": "float", "unit": "m", "value": 0 @@ -15848,6 +16865,7 @@ "max": "", "min": "0", "name": "W3", + "size": "0", "type": "float", "unit": "m", "value": 0 @@ -15891,6 +16909,7 @@ "max": "", "min": "0", "name": "W1", + "size": "0", "type": "float", "unit": "m", "value": 0.008 @@ -15901,6 +16920,7 @@ "max": "", "min": "0", "name": "W3", + "size": "0", "type": "float", "unit": "m", "value": 0.0116 @@ -15911,6 +16931,7 @@ "max": "", "min": "0", "name": "H2", + "size": "0", "type": "float", "unit": "m", "value": 0.0148 @@ -15921,6 +16942,7 @@ "max": "", "min": "0", "name": "R1", + "size": "0", "type": "float", "unit": "m", "value": 0.00075 @@ -15931,6 +16953,7 @@ "max": "", "min": "0", "name": "H3", + "size": "0", "type": "float", "unit": "m", "value": 0.001 @@ -15964,6 +16987,7 @@ "max": "", "min": "", "name": "type_cell", + "size": "", "type": "str", "unit": "-", "value": "triangle" @@ -15974,6 +16998,7 @@ "max": "", "min": "", "name": "label", + "size": "", "type": "str", "unit": "-", "value": "None" @@ -15984,6 +17009,7 @@ "max": "3", "min": "1", "name": "dimension", + "size": "", "type": "int", "unit": "-", "value": 2 @@ -15994,6 +17020,7 @@ "max": "", "min": "", "name": "unit", + "size": "", "type": "str", "unit": "-", "value": "" @@ -16026,6 +17053,7 @@ "max": "", "min": "", "name": "field", + "size": "", "type": "SciDataTool.Classes.DataND.DataND", "unit": "-", "value": "None" @@ -16060,6 +17088,7 @@ "max": "", "min": "", "name": "field", + "size": "", "type": "ndarray", "unit": "-", "value": null @@ -16070,6 +17099,7 @@ "max": "", "min": "", "name": "indice", + "size": "", "type": "ndarray", "unit": "-", "value": null @@ -16080,6 +17110,7 @@ "max": "", "min": "", "name": "axis_name", + "size": "", "type": "list", "unit": "-", "value": null @@ -16090,6 +17121,7 @@ "max": "", "min": "", "name": "axis_size", + "size": "", "type": "list", "unit": "-", "value": null @@ -16122,6 +17154,7 @@ "max": "", "min": "", "name": "field", + "size": "", "type": "SciDataTool.Classes.VectorField.VectorField", "unit": "-", "value": "None" @@ -16152,6 +17185,7 @@ "max": "", "min": "", "name": "sections", + "size": "", "type": "list", "unit": "", "value": [] @@ -16188,6 +17222,7 @@ "max": "", "min": "", "name": "Kmesh_fineness", + "size": "0", "type": "float", "unit": "", "value": 1 @@ -16198,6 +17233,7 @@ "max": "", "min": "", "name": "path_name", + "size": "0", "type": "str", "unit": "", "value": "" @@ -16208,6 +17244,7 @@ "max": "", "min": "", "name": "FEA_dict_enforced", + "size": "0", "type": "dict", "unit": "", "value": "" @@ -16218,6 +17255,7 @@ "max": "", "min": "", "name": "is_get_mesh", + "size": "0", "type": "bool", "unit": "", "value": 0 @@ -16228,6 +17266,7 @@ "max": "", "min": "", "name": "is_save_FEA", + "size": "0", "type": "bool", "unit": "", "value": 1 @@ -16238,6 +17277,7 @@ "max": "", "min": "", "name": "transform_list", + "size": "0", "type": "list", "unit": "", "value": [] @@ -16248,6 +17288,7 @@ "max": "", "min": "", "name": "include_magnets", + "size": "", "type": "bool", "unit": "", "value": 1 @@ -16281,12 +17322,678 @@ "max": "", "min": "", "name": "logger_name", + "size": "0", "type": "str", "unit": "-", "value": "Pyleecan.Structural" } ] }, + "Subdomain": { + "constants": [ + { + "name": "VERSION", + "value": "1" + } + ], + "daughters": [ + "Subdomain_Airgap", + "Subdomain_MagnetSurface", + "Subdomain_Slot", + "Subdomain_SlotOpening" + ], + "desc": "Abstract class for all subdomains", + "is_internal": false, + "methods": [], + "mother": "", + "name": "Subdomain", + "package": "Simulation", + "path": "pyleecan/Generator/ClassesRef/Simulation/Subdomain.csv", + "properties": [ + { + "as_dict": "", + "desc": "Array of harmonic numbers ", + "max": "", + "min": "0", + "name": "k", + "size": "", + "type": "ndarray", + "unit": "", + "value": null + }, + { + "as_dict": "", + "desc": "Number of identical subdomains in model", + "max": "", + "min": "0", + "name": "number", + "size": "", + "type": "int", + "unit": "", + "value": null + }, + { + "as_dict": "", + "desc": "Relative permeability of subdomain", + "max": "", + "min": "1", + "name": "permeability_relative", + "size": "", + "type": "float", + "unit": "", + "value": 1 + } + ] + }, + "SubdomainModel": { + "constants": [ + { + "name": "VERSION", + "value": "1" + } + ], + "daughters": [ + "SubdomainModel_SPMSM" + ], + "desc": "Abstract class for all the Subdomain model classes", + "is_internal": false, + "methods": [], + "mother": "", + "name": "SubdomainModel", + "package": "Simulation", + "path": "pyleecan/Generator/ClassesRef/Simulation/SubdomainModel.csv", + "properties": [ + { + "as_dict": "", + "desc": "Airgap subdomain", + "max": "", + "min": "", + "name": "airgap", + "size": "", + "type": "Subdomain_Airgap", + "unit": "", + "value": null + }, + { + "as_dict": "", + "desc": "Spatial periodicity factor", + "max": "", + "min": "1", + "name": "per_a", + "size": "", + "type": "int", + "unit": "", + "value": null + }, + { + "as_dict": "", + "desc": "Polar equivalent of machine", + "max": "", + "min": "", + "name": "machine_polar_eq", + "size": "", + "type": "Machine", + "unit": "", + "value": null + }, + { + "as_dict": "", + "desc": "True if there is spatial anti-periodicity", + "max": "", + "min": "", + "name": "is_antiper_a", + "size": "", + "type": "bool", + "unit": "", + "value": null + }, + { + "as_dict": "", + "desc": "Topological matrix", + "max": "", + "min": "", + "name": "mat", + "size": "", + "type": "ndarray", + "unit": "", + "value": null + }, + { + "as_dict": "", + "desc": "Source vector", + "max": "", + "min": "", + "name": "vect", + "size": "", + "type": "ndarray", + "unit": "", + "value": null + }, + { + "as_dict": "", + "desc": "List of constants number", + "max": "", + "min": "", + "name": "csts_number", + "size": "", + "type": "list", + "unit": "", + "value": null + }, + { + "as_dict": "", + "desc": "List of constants positions in topoligical matrix", + "max": "", + "min": "", + "name": "csts_position", + "size": "", + "type": "list", + "unit": "", + "value": null + } + ] + }, + "SubdomainModel_SPMSM": { + "constants": [ + { + "name": "VERSION", + "value": "1" + } + ], + "daughters": [], + "desc": "Subdomain model for Surface Permanent Magnet Synchronous Machine assuming infinite permeability in yokes", + "is_internal": false, + "methods": [ + "set_subdomains", + "solve", + "store_constants" + ], + "mother": "SubdomainModel", + "name": "SubdomainModel_SPMSM", + "package": "Simulation", + "path": "pyleecan/Generator/ClassesRef/Simulation/SubdomainModel_SPMSM.csv", + "properties": [ + { + "as_dict": "", + "desc": "Subdomain for stator slots", + "max": "", + "min": "", + "name": "stator_slot", + "size": "", + "type": "Subdomain_Slot", + "unit": "", + "value": null + }, + { + "as_dict": "", + "desc": "Subdomain for surface magnets", + "max": "", + "min": "", + "name": "rotor_magnet_surface", + "size": "", + "type": "Subdomain_MagnetSurface", + "unit": "", + "value": null + }, + { + "as_dict": "", + "desc": "Subdomain for rotor yoke", + "max": "", + "min": "", + "name": "rotor_yoke", + "size": "", + "type": "Subdomain", + "unit": "", + "value": null + } + ] + }, + "Subdomain_Airgap": { + "constants": [ + { + "name": "VERSION", + "value": "1" + } + ], + "daughters": [], + "desc": "Subdomain class for airgap region", + "is_internal": false, + "methods": [ + "add_constants_numbers", + "comp_flux_density", + "comp_torque" + ], + "mother": "Subdomain", + "name": "Subdomain_Airgap", + "package": "Simulation", + "path": "pyleecan/Generator/ClassesRef/Simulation/Subdomain_Airgap.csv", + "properties": [ + { + "as_dict": "", + "desc": "First integration constant function of harmonic number and time", + "max": "", + "min": "", + "name": "A", + "size": "[K, Nt]", + "type": "ndarray", + "unit": "", + "value": null + }, + { + "as_dict": "", + "desc": "Second integration constant function of harmonic number and time", + "max": "", + "min": "", + "name": "B", + "size": "[K, Nt]", + "type": "ndarray", + "unit": "", + "value": null + }, + { + "as_dict": "", + "desc": "Third integration constant function of harmonic number and time", + "max": "", + "min": "", + "name": "C", + "size": "[K, Nt]", + "type": "ndarray", + "unit": "", + "value": null + }, + { + "as_dict": "", + "desc": "Fourth integration constant function of harmonic number and time", + "max": "", + "min": "", + "name": "D", + "size": "[K, Nt]", + "type": "ndarray", + "unit": "", + "value": null + }, + { + "as_dict": "", + "desc": "Rotor bore radius", + "max": "", + "min": "", + "name": "Rrbo", + "size": "", + "type": "float", + "unit": "", + "value": null + }, + { + "as_dict": "", + "desc": "Stator bore radius", + "max": "", + "min": "", + "name": "Rsbo", + "size": "", + "type": "float", + "unit": "", + "value": null + } + ] + }, + "Subdomain_MagnetSurface": { + "constants": [ + { + "name": "VERSION", + "value": "1" + } + ], + "daughters": [], + "desc": "Subdomain class for surface permanent magnet region", + "is_internal": false, + "methods": [ + "add_constants_numbers", + "comp_flux_density", + "comp_interface_airgap", + "comp_magnet_solution", + "comp_magnet_source" + ], + "mother": "Subdomain", + "name": "Subdomain_MagnetSurface", + "package": "Simulation", + "path": "pyleecan/Generator/ClassesRef/Simulation/Subdomain_MagnetSurface.csv", + "properties": [ + { + "as_dict": "", + "desc": "Magnetization type given by machine properties", + "max": "3", + "min": "0", + "name": "type_magnetization", + "size": "", + "type": "int", + "unit": "", + "value": 0 + }, + { + "as_dict": "", + "desc": "Angular width of a magnet", + "max": "", + "min": "0", + "name": "magnet_width", + "size": "", + "type": "float", + "unit": "rad", + "value": null + }, + { + "as_dict": "", + "desc": "Radius at magnet / yoke interface", + "max": "", + "min": "0", + "name": "Ryoke", + "size": "", + "type": "float", + "unit": "m", + "value": null + }, + { + "as_dict": "", + "desc": "First integration constant function of harmonic number and time", + "max": "", + "min": "", + "name": "A", + "size": "", + "type": "ndarray", + "unit": "", + "value": null + }, + { + "as_dict": "", + "desc": "Second integration constant function of harmonic number and time", + "max": "", + "min": "", + "name": "B", + "size": "", + "type": "ndarray", + "unit": "", + "value": null + }, + { + "as_dict": "", + "desc": "Third integration constant function of harmonic number and time", + "max": "", + "min": "", + "name": "C", + "size": "", + "type": "ndarray", + "unit": "", + "value": null + }, + { + "as_dict": "", + "desc": "Fourth integration constant function of harmonic number and time", + "max": "", + "min": "", + "name": "D", + "size": "", + "type": "ndarray", + "unit": "", + "value": null + }, + { + "as_dict": "", + "desc": "Radius at magnet / airgap interface", + "max": "", + "min": "0", + "name": "Rbore", + "size": "", + "type": "float", + "unit": "m", + "value": null + }, + { + "as_dict": "", + "desc": "Fourier series of radial magnetization", + "max": "", + "min": "", + "name": "Mrn", + "size": "", + "type": "ndarray", + "unit": "", + "value": null + }, + { + "as_dict": "", + "desc": "Fourier series of circumferential magnetization", + "max": "", + "min": "", + "name": "Mtn", + "size": "", + "type": "ndarray", + "unit": "", + "value": null + } + ] + }, + "Subdomain_Slot": { + "constants": [ + { + "name": "VERSION", + "value": "1" + } + ], + "daughters": [ + "Subdomain_SlotOpening" + ], + "desc": "Subdomain class for slots regions without openings and with windings", + "is_internal": false, + "methods": [ + "add_constants_numbers", + "comp_current_solution", + "comp_current_source", + "comp_flux_density", + "comp_interface_airgap", + "comp_Phi_wind" + ], + "mother": "Subdomain", + "name": "Subdomain_Slot", + "package": "Simulation", + "path": "pyleecan/Generator/ClassesRef/Simulation/Subdomain_Slot.csv", + "properties": [ + { + "as_dict": "", + "desc": "First integration constant function of harmonic number and time", + "max": "", + "min": "", + "name": "A", + "size": "[Zs, Nt]", + "type": "ndarray", + "unit": "", + "value": null + }, + { + "as_dict": "", + "desc": "Second integration constant function of harmonic number and time", + "max": "", + "min": "", + "name": "B", + "size": "[K*Zs, Nt]", + "type": "ndarray", + "unit": "", + "value": null + }, + { + "as_dict": "", + "desc": "Angle value at slot center", + "max": "", + "min": "", + "name": "center_angle", + "size": "", + "type": "ndarray", + "unit": "rad", + "value": null + }, + { + "as_dict": "", + "desc": "Angular width of slot", + "max": "", + "min": "0", + "name": "slot_width", + "size": "", + "type": "float", + "unit": "rad", + "value": null + }, + { + "as_dict": "", + "desc": "Average current density in slots", + "max": "", + "min": "", + "name": "Ji", + "size": "[Zs, Nt]", + "type": "ndarray", + "unit": "A/m^2", + "value": null + }, + { + "as_dict": "", + "desc": "Current density space harmonics in slots for concentrated double layer windings", + "max": "", + "min": "", + "name": "Jik", + "size": "[K*Zs, Nt]", + "type": "ndarray", + "unit": "A/m^2", + "value": null + }, + { + "as_dict": "", + "desc": "Radius at slot / yoke interface", + "max": "", + "min": "0", + "name": "Ryoke", + "size": "", + "type": "float", + "unit": "m", + "value": null + }, + { + "as_dict": "", + "desc": "Radius at slot / airgap interface", + "max": "", + "min": "0", + "name": "Rbore", + "size": "", + "type": "float", + "unit": "m", + "value": null + }, + { + "as_dict": "", + "desc": "Number of subdomains accounting for spatial (anti-)periodicity", + "max": "", + "min": "1", + "name": "number_per_a", + "size": "", + "type": "int", + "unit": "", + "value": null + } + ] + }, + "Subdomain_SlotOpening": { + "constants": [ + { + "name": "VERSION", + "value": "1" + } + ], + "daughters": [], + "desc": "Subdomain class for slots regions", + "is_internal": false, + "methods": [ + "add_constants_numbers", + "comp_flux_density" + ], + "mother": "Subdomain_Slot", + "name": "Subdomain_SlotOpening", + "package": "Simulation", + "path": "pyleecan/Generator/ClassesRef/Simulation/Subdomain_SlotOpening.csv", + "properties": [ + { + "as_dict": "", + "desc": "First integration constant function of harmonic number and time in slot opening subdomain", + "max": "", + "min": "", + "name": "C", + "size": "[Zs, Nt]", + "type": "ndarray", + "unit": "", + "value": null + }, + { + "as_dict": "", + "desc": "Second integration constant function of harmonic number and time in slot opening subdomain", + "max": "", + "min": "", + "name": "D", + "size": "[Zs, Nt]", + "type": "ndarray", + "unit": "", + "value": null + }, + { + "as_dict": "", + "desc": "Third integration constant function of harmonic number and time in slot opening subdomain", + "max": "", + "min": "", + "name": "E", + "size": "[V*Zs, Nt]", + "type": "ndarray", + "unit": "", + "value": null + }, + { + "as_dict": "", + "desc": "Fourth integration constant function of harmonic number and time in slot opening subdomain", + "max": "", + "min": "", + "name": "F", + "size": "[V*Zs, Nt]", + "type": "ndarray", + "unit": "", + "value": null + }, + { + "as_dict": "", + "desc": "Angular width of slot opening", + "max": "", + "min": "0", + "name": "opening_width", + "size": "", + "type": "float", + "unit": "rad", + "value": null + }, + { + "as_dict": "", + "desc": "Harmonic vector for slot opening", + "max": "", + "min": "", + "name": "v", + "size": "[V,1]", + "type": "ndarray", + "unit": "", + "value": null + }, + { + "as_dict": "", + "desc": "Radius of slot opening / slot interface", + "max": "", + "min": "0", + "name": "Ropening", + "size": "", + "type": "float", + "unit": "m", + "value": null + } + ] + }, "SurfLine": { "constants": [ { @@ -16321,6 +18028,7 @@ "max": "", "min": "", "name": "line_list", + "size": "0", "type": "[Line]", "unit": "-", "value": [] @@ -16360,6 +18068,7 @@ "max": "", "min": "", "name": "out_surf", + "size": "0", "type": "Surface", "unit": "-", "value": "" @@ -16370,6 +18079,7 @@ "max": "", "min": "", "name": "in_surf", + "size": "0", "type": "Surface", "unit": "-", "value": "" @@ -16411,6 +18121,7 @@ "max": "", "min": "", "name": "point_ref", + "size": "0", "type": "complex", "unit": "-", "value": 0 @@ -16421,6 +18132,7 @@ "max": "", "min": "", "name": "label", + "size": "0", "type": "str", "unit": "-", "value": "" @@ -16459,6 +18171,7 @@ "max": "", "min": "0", "name": "height", + "size": "", "type": "float", "unit": "m", "value": 1 @@ -16469,6 +18182,7 @@ "max": "", "min": "0", "name": "W2", + "size": "", "type": "float", "unit": "m", "value": 1 @@ -16479,6 +18193,7 @@ "max": "", "min": "0", "name": "W1", + "size": "", "type": "float", "unit": "m", "value": 1 @@ -16514,6 +18229,7 @@ "max": "1", "min": "0", "name": "unit_m", + "size": "0", "type": "int", "unit": "-", "value": 0 @@ -16524,6 +18240,7 @@ "max": "1", "min": "0", "name": "unit_rad", + "size": "0", "type": "int", "unit": "-", "value": 0 @@ -16534,6 +18251,7 @@ "max": "1", "min": "0", "name": "unit_m2", + "size": "0", "type": "int", "unit": "-", "value": 0 @@ -16574,6 +18292,7 @@ "max": "", "min": "", "name": "OP_matrix", + "size": "(Nsimu, Nvalue)", "type": "OPMatrix", "unit": "-", "value": null @@ -16652,6 +18371,7 @@ "max": "", "min": "", "name": "objective_list", + "size": "0", "type": "[OptiObjective]", "unit": "-", "value": "" @@ -16662,6 +18382,7 @@ "max": "", "min": "", "name": "constraint_list", + "size": "0", "type": "[OptiConstraint]", "unit": "-", "value": "" @@ -16672,6 +18393,7 @@ "max": "", "min": "", "name": "solver", + "size": "0", "type": "OptiSolver", "unit": "-", "value": null @@ -16707,6 +18429,7 @@ "max": "", "min": "", "name": "paramexplorer_list", + "size": "0", "type": "[ParamExplorer]", "unit": "-", "value": "" @@ -16777,6 +18500,7 @@ "max": "", "min": "", "name": "name", + "size": "0", "type": "str", "unit": "-", "value": "" @@ -16787,6 +18511,7 @@ "max": "", "min": "", "name": "desc", + "size": "0", "type": "str", "unit": "-", "value": "" @@ -16797,6 +18522,7 @@ "max": "", "min": "", "name": "datakeeper_list", + "size": "0", "type": "[DataKeeper]", "unit": "-", "value": "" @@ -16807,6 +18533,7 @@ "max": "", "min": "", "name": "is_keep_all_output", + "size": "0", "type": "bool", "unit": "-", "value": false @@ -16817,6 +18544,7 @@ "max": "", "min": "", "name": "stop_if_error", + "size": "0", "type": "bool", "unit": "-", "value": false @@ -16827,6 +18555,7 @@ "max": "", "min": "", "name": "var_simu", + "size": "", "type": "VarSimu", "unit": "-", "value": null @@ -16837,6 +18566,7 @@ "max": "", "min": "", "name": "nb_simu", + "size": "0", "type": "int", "unit": "-", "value": 0 @@ -16847,6 +18577,7 @@ "max": "", "min": "", "name": "is_reuse_femm_file", + "size": "0", "type": "bool", "unit": "-", "value": 1 @@ -16857,6 +18588,7 @@ "max": "", "min": "", "name": "postproc_list", + "size": "0", "type": "[Post]", "unit": "-", "value": "" @@ -16867,6 +18599,7 @@ "max": "", "min": "", "name": "pre_keeper_postproc_list", + "size": "0", "type": "[Post]", "unit": "-", "value": null @@ -16877,6 +18610,7 @@ "max": "", "min": "", "name": "post_keeper_postproc_list", + "size": "0", "type": "[Post]", "unit": "-", "value": null @@ -16887,6 +18621,7 @@ "max": "", "min": "", "name": "is_reuse_LUT", + "size": "0", "type": "bool", "unit": "-", "value": 1 @@ -16923,6 +18658,7 @@ "max": "", "min": "0", "name": "D0", + "size": "0", "type": "float", "unit": "m", "value": 1 @@ -16933,6 +18669,7 @@ "max": "", "min": "0", "name": "H0", + "size": "0", "type": "float", "unit": "m", "value": 1 @@ -16969,6 +18706,7 @@ "max": "", "min": "0", "name": "D0", + "size": "0", "type": "float", "unit": "m", "value": 1 @@ -16979,6 +18717,7 @@ "max": "", "min": "0", "name": "H0", + "size": "0", "type": "float", "unit": "m", "value": 1 @@ -16989,6 +18728,7 @@ "max": "6.29", "min": "0", "name": "W1", + "size": "0", "type": "float", "unit": "rad", "value": 1 @@ -17025,6 +18765,7 @@ "max": "", "min": "0", "name": "D0", + "size": "0", "type": "float", "unit": "m", "value": 1 @@ -17035,6 +18776,7 @@ "max": "", "min": "0", "name": "H0", + "size": "0", "type": "float", "unit": "m", "value": 1 @@ -17045,6 +18787,7 @@ "max": "", "min": "0", "name": "W1", + "size": "0", "type": "float", "unit": "m", "value": 1 @@ -17055,6 +18798,7 @@ "max": "", "min": "0", "name": "W2", + "size": "0", "type": "float", "unit": "m", "value": 1 @@ -17106,6 +18850,7 @@ "max": "", "min": "", "name": "is_reverse_wind", + "size": "0", "type": "bool", "unit": "-", "value": 0 @@ -17116,6 +18861,7 @@ "max": "", "min": "", "name": "Nslot_shift_wind", + "size": "0", "type": "int", "unit": "-", "value": 0 @@ -17126,6 +18872,7 @@ "max": "", "min": "0", "name": "qs", + "size": "0", "type": "int", "unit": "-", "value": 3 @@ -17136,6 +18883,7 @@ "max": "", "min": "1", "name": "Ntcoil", + "size": "0", "type": "int", "unit": "-", "value": 7 @@ -17146,6 +18894,7 @@ "max": "", "min": "1", "name": "Npcp", + "size": "0", "type": "int", "unit": "-", "value": 2 @@ -17156,6 +18905,7 @@ "max": "1", "min": "-1", "name": "type_connection", + "size": "0", "type": "int", "unit": "-", "value": 0 @@ -17166,6 +18916,7 @@ "max": "", "min": "1", "name": "p", + "size": "0", "type": "int", "unit": "-", "value": 3 @@ -17176,6 +18927,7 @@ "max": "", "min": "0", "name": "Lewout", + "size": "0", "type": "float", "unit": "m", "value": 0.015 @@ -17186,6 +18938,7 @@ "max": "", "min": "", "name": "conductor", + "size": "", "type": "Conductor", "unit": "-", "value": "" @@ -17196,6 +18949,7 @@ "max": "", "min": "", "name": "coil_pitch", + "size": "", "type": "int", "unit": "", "value": 1 @@ -17206,6 +18960,7 @@ "max": "", "min": "", "name": "wind_mat", + "size": "4", "type": "ndarray", "unit": "-", "value": null @@ -17216,6 +18971,7 @@ "max": "", "min": "1", "name": "Nlayer", + "size": "", "type": "int", "unit": "", "value": 1 @@ -17226,6 +18982,7 @@ "max": "", "min": "1", "name": "per_a", + "size": "", "type": "int", "unit": "", "value": null @@ -17236,6 +18993,7 @@ "max": "", "min": "", "name": "is_aper_a", + "size": "", "type": "bool", "unit": "", "value": null @@ -17246,6 +19004,7 @@ "max": "", "min": "", "name": "end_winding", + "size": "", "type": "EndWinding", "unit": "-", "value": "" @@ -17256,6 +19015,7 @@ "max": "", "min": "", "name": "is_reverse_layer", + "size": "0", "type": "bool", "unit": "-", "value": 0 @@ -17266,6 +19026,7 @@ "max": "", "min": "", "name": "is_change_layer", + "size": "0", "type": "bool", "unit": "-", "value": 0 @@ -17276,6 +19037,7 @@ "max": "", "min": "", "name": "is_permute_B_C", + "size": "0", "type": "bool", "unit": "", "value": 0 @@ -17286,6 +19048,7 @@ "max": "", "min": "", "name": "dual_tri_phase_shift", + "size": "0", "type": "float", "unit": "rad", "value": null @@ -17296,6 +19059,7 @@ "max": "", "min": "", "name": "is_wye", + "size": "0", "type": "bool", "unit": "-", "value": 1 @@ -17406,6 +19170,7 @@ "max": "", "min": "", "name": "paramexplorer_list", + "size": "0", "type": "[ParamExplorer]", "unit": "-", "value": "" @@ -17416,6 +19181,7 @@ "max": "", "min": "", "name": "output_list", + "size": "0", "type": "[Output]", "unit": "-", "value": "" @@ -17426,6 +19192,7 @@ "max": "", "min": "", "name": "xoutput_dict", + "size": "0", "type": "{DataKeeper}", "unit": "-", "value": "" @@ -17436,6 +19203,7 @@ "max": "", "min": "0", "name": "nb_simu", + "size": "0", "type": "int", "unit": "-", "value": 0 @@ -17446,6 +19214,7 @@ "max": "", "min": "", "name": "xoutput_ref", + "size": "0", "type": "Output", "unit": "-", "value": null @@ -17456,6 +19225,7 @@ "max": "", "min": "", "name": "xoutput_ref_index", + "size": "0", "type": "int", "unit": "-", "value": null diff --git a/pyleecan/Classes/LamSlotMag.py b/pyleecan/Classes/LamSlotMag.py index e9fb6bd59..8e58e9d6c 100644 --- a/pyleecan/Classes/LamSlotMag.py +++ b/pyleecan/Classes/LamSlotMag.py @@ -52,6 +52,11 @@ except ImportError as error: get_magnet_by_label = error +try: + from ..Methods.Machine.LamSlotMag.get_polar_eq import get_polar_eq +except ImportError as error: + get_polar_eq = error + try: from ..Methods.Machine.LamSlotMag.set_Lmag import set_Lmag except ImportError as error: @@ -146,6 +151,17 @@ class LamSlotMag(LamSlotM): ) else: get_magnet_by_label = get_magnet_by_label + # cf Methods.Machine.LamSlotMag.get_polar_eq + if isinstance(get_polar_eq, ImportError): + get_polar_eq = property( + fget=lambda x: raise_( + ImportError( + "Can't use LamSlotMag method get_polar_eq: " + str(get_polar_eq) + ) + ) + ) + else: + get_polar_eq = get_polar_eq # cf Methods.Machine.LamSlotMag.set_Lmag if isinstance(set_Lmag, ImportError): set_Lmag = property( diff --git a/pyleecan/Classes/MagSDM.py b/pyleecan/Classes/MagSDM.py new file mode 100644 index 000000000..5077e97e0 --- /dev/null +++ b/pyleecan/Classes/MagSDM.py @@ -0,0 +1,409 @@ +# -*- coding: utf-8 -*- +# File generated according to Generator/ClassesRef/Simulation/MagSDM.csv +# WARNING! All changes made in this file will be lost! +"""Method code available at https://github.com/Eomys/pyleecan/tree/master/pyleecan/Methods/Simulation/MagSDM +""" + +from os import linesep +from sys import getsizeof +from logging import getLogger +from ._check import check_var, raise_ +from ..Functions.get_logger import get_logger +from ..Functions.save import save +from ..Functions.load import load_init_dict +from ..Functions.Load.import_class import import_class +from copy import deepcopy +from .Magnetics import Magnetics + +# Import all class method +# Try/catch to remove unnecessary dependencies in unused method +try: + from ..Methods.Simulation.MagSDM.comp_flux_airgap import comp_flux_airgap +except ImportError as error: + comp_flux_airgap = error + + +from numpy import isnan +from ._check import InitUnKnowClassError + + +class MagSDM(Magnetics): + + VERSION = 1 + + # cf Methods.Simulation.MagSDM.comp_flux_airgap + if isinstance(comp_flux_airgap, ImportError): + comp_flux_airgap = property( + fget=lambda x: raise_( + ImportError( + "Can't use MagSDM method comp_flux_airgap: " + str(comp_flux_airgap) + ) + ) + ) + else: + comp_flux_airgap = comp_flux_airgap + # generic save method is available in all object + save = save + # get_logger method is available in all object + get_logger = get_logger + + def __init__( + self, + subdomain_model=None, + Nharm_coeff=1, + is_remove_slotS=False, + is_remove_slotR=False, + is_remove_ventS=False, + is_remove_ventR=False, + is_mmfs=True, + is_mmfr=True, + type_BH_stator=0, + type_BH_rotor=0, + is_periodicity_t=False, + is_periodicity_a=False, + angle_stator_shift=0, + angle_rotor_shift=0, + logger_name="Pyleecan.Magnetics", + Slice_enforced=None, + Nslices_enforced=None, + type_distribution_enforced=None, + is_current_harm=True, + T_mag=20, + is_periodicity_rotor=False, + init_dict=None, + init_str=None, + ): + """Constructor of the class. Can be use in three ways : + - __init__ (arg1 = 1, arg3 = 5) every parameters have name and default values + for pyleecan type, -1 will call the default constructor + - __init__ (init_dict = d) d must be a dictionary with property names as keys + - __init__ (init_str = s) s must be a string + s is the file path to load + + ndarray or list can be given for Vector and Matrix + object or dict can be given for pyleecan Object""" + + if init_str is not None: # Load from a file + init_dict = load_init_dict(init_str)[1] + if init_dict is not None: # Initialisation by dict + assert type(init_dict) is dict + # Overwrite default value with init_dict content + if "subdomain_model" in list(init_dict.keys()): + subdomain_model = init_dict["subdomain_model"] + if "Nharm_coeff" in list(init_dict.keys()): + Nharm_coeff = init_dict["Nharm_coeff"] + if "is_remove_slotS" in list(init_dict.keys()): + is_remove_slotS = init_dict["is_remove_slotS"] + if "is_remove_slotR" in list(init_dict.keys()): + is_remove_slotR = init_dict["is_remove_slotR"] + if "is_remove_ventS" in list(init_dict.keys()): + is_remove_ventS = init_dict["is_remove_ventS"] + if "is_remove_ventR" in list(init_dict.keys()): + is_remove_ventR = init_dict["is_remove_ventR"] + if "is_mmfs" in list(init_dict.keys()): + is_mmfs = init_dict["is_mmfs"] + if "is_mmfr" in list(init_dict.keys()): + is_mmfr = init_dict["is_mmfr"] + if "type_BH_stator" in list(init_dict.keys()): + type_BH_stator = init_dict["type_BH_stator"] + if "type_BH_rotor" in list(init_dict.keys()): + type_BH_rotor = init_dict["type_BH_rotor"] + if "is_periodicity_t" in list(init_dict.keys()): + is_periodicity_t = init_dict["is_periodicity_t"] + if "is_periodicity_a" in list(init_dict.keys()): + is_periodicity_a = init_dict["is_periodicity_a"] + if "angle_stator_shift" in list(init_dict.keys()): + angle_stator_shift = init_dict["angle_stator_shift"] + if "angle_rotor_shift" in list(init_dict.keys()): + angle_rotor_shift = init_dict["angle_rotor_shift"] + if "logger_name" in list(init_dict.keys()): + logger_name = init_dict["logger_name"] + if "Slice_enforced" in list(init_dict.keys()): + Slice_enforced = init_dict["Slice_enforced"] + if "Nslices_enforced" in list(init_dict.keys()): + Nslices_enforced = init_dict["Nslices_enforced"] + if "type_distribution_enforced" in list(init_dict.keys()): + type_distribution_enforced = init_dict["type_distribution_enforced"] + if "is_current_harm" in list(init_dict.keys()): + is_current_harm = init_dict["is_current_harm"] + if "T_mag" in list(init_dict.keys()): + T_mag = init_dict["T_mag"] + if "is_periodicity_rotor" in list(init_dict.keys()): + is_periodicity_rotor = init_dict["is_periodicity_rotor"] + # Set the properties (value check and convertion are done in setter) + self.subdomain_model = subdomain_model + self.Nharm_coeff = Nharm_coeff + # Call Magnetics init + super(MagSDM, self).__init__( + is_remove_slotS=is_remove_slotS, + is_remove_slotR=is_remove_slotR, + is_remove_ventS=is_remove_ventS, + is_remove_ventR=is_remove_ventR, + is_mmfs=is_mmfs, + is_mmfr=is_mmfr, + type_BH_stator=type_BH_stator, + type_BH_rotor=type_BH_rotor, + is_periodicity_t=is_periodicity_t, + is_periodicity_a=is_periodicity_a, + angle_stator_shift=angle_stator_shift, + angle_rotor_shift=angle_rotor_shift, + logger_name=logger_name, + Slice_enforced=Slice_enforced, + Nslices_enforced=Nslices_enforced, + type_distribution_enforced=type_distribution_enforced, + is_current_harm=is_current_harm, + T_mag=T_mag, + is_periodicity_rotor=is_periodicity_rotor, + ) + # The class is frozen (in Magnetics init), for now it's impossible to + # add new properties + + def __str__(self): + """Convert this object in a readeable string (for print)""" + + MagSDM_str = "" + # Get the properties inherited from Magnetics + MagSDM_str += super(MagSDM, self).__str__() + if self.subdomain_model is not None: + tmp = ( + self.subdomain_model.__str__() + .replace(linesep, linesep + "\t") + .rstrip("\t") + ) + MagSDM_str += "subdomain_model = " + tmp + else: + MagSDM_str += "subdomain_model = None" + linesep + linesep + MagSDM_str += "Nharm_coeff = " + str(self.Nharm_coeff) + linesep + return MagSDM_str + + def __eq__(self, other): + """Compare two objects (skip parent)""" + + if type(other) != type(self): + return False + + # Check the properties inherited from Magnetics + if not super(MagSDM, self).__eq__(other): + return False + if other.subdomain_model != self.subdomain_model: + return False + if other.Nharm_coeff != self.Nharm_coeff: + return False + return True + + def compare(self, other, name="self", ignore_list=None, is_add_value=False): + """Compare two objects and return list of differences""" + + if ignore_list is None: + ignore_list = list() + if type(other) != type(self): + return ["type(" + name + ")"] + diff_list = list() + + # Check the properties inherited from Magnetics + diff_list.extend( + super(MagSDM, self).compare( + other, name=name, ignore_list=ignore_list, is_add_value=is_add_value + ) + ) + if (other.subdomain_model is None and self.subdomain_model is not None) or ( + other.subdomain_model is not None and self.subdomain_model is None + ): + diff_list.append(name + ".subdomain_model None mismatch") + elif self.subdomain_model is not None: + diff_list.extend( + self.subdomain_model.compare( + other.subdomain_model, + name=name + ".subdomain_model", + ignore_list=ignore_list, + is_add_value=is_add_value, + ) + ) + if ( + other._Nharm_coeff is not None + and self._Nharm_coeff is not None + and isnan(other._Nharm_coeff) + and isnan(self._Nharm_coeff) + ): + pass + elif other._Nharm_coeff != self._Nharm_coeff: + if is_add_value: + val_str = ( + " (self=" + + str(self._Nharm_coeff) + + ", other=" + + str(other._Nharm_coeff) + + ")" + ) + diff_list.append(name + ".Nharm_coeff" + val_str) + else: + diff_list.append(name + ".Nharm_coeff") + # Filter ignore differences + diff_list = list(filter(lambda x: x not in ignore_list, diff_list)) + return diff_list + + def __sizeof__(self): + """Return the size in memory of the object (including all subobject)""" + + S = 0 # Full size of the object + + # Get size of the properties inherited from Magnetics + S += super(MagSDM, self).__sizeof__() + S += getsizeof(self.subdomain_model) + S += getsizeof(self.Nharm_coeff) + return S + + def as_dict(self, type_handle_ndarray=0, keep_function=False, **kwargs): + """ + Convert this object in a json serializable dict (can be use in __init__). + type_handle_ndarray: int + How to handle ndarray (0: tolist, 1: copy, 2: nothing) + keep_function : bool + True to keep the function object, else return str + Optional keyword input parameter is for internal use only + and may prevent json serializability. + """ + + # Get the properties inherited from Magnetics + MagSDM_dict = super(MagSDM, self).as_dict( + type_handle_ndarray=type_handle_ndarray, + keep_function=keep_function, + **kwargs + ) + if self.subdomain_model is None: + MagSDM_dict["subdomain_model"] = None + else: + MagSDM_dict["subdomain_model"] = self.subdomain_model.as_dict( + type_handle_ndarray=type_handle_ndarray, + keep_function=keep_function, + **kwargs + ) + MagSDM_dict["Nharm_coeff"] = self.Nharm_coeff + # The class name is added to the dict for deserialisation purpose + # Overwrite the mother class name + MagSDM_dict["__class__"] = "MagSDM" + return MagSDM_dict + + def copy(self): + """Creates a deepcopy of the object""" + + # Handle deepcopy of all the properties + if self.subdomain_model is None: + subdomain_model_val = None + else: + subdomain_model_val = self.subdomain_model.copy() + Nharm_coeff_val = self.Nharm_coeff + is_remove_slotS_val = self.is_remove_slotS + is_remove_slotR_val = self.is_remove_slotR + is_remove_ventS_val = self.is_remove_ventS + is_remove_ventR_val = self.is_remove_ventR + is_mmfs_val = self.is_mmfs + is_mmfr_val = self.is_mmfr + type_BH_stator_val = self.type_BH_stator + type_BH_rotor_val = self.type_BH_rotor + is_periodicity_t_val = self.is_periodicity_t + is_periodicity_a_val = self.is_periodicity_a + angle_stator_shift_val = self.angle_stator_shift + angle_rotor_shift_val = self.angle_rotor_shift + logger_name_val = self.logger_name + if self.Slice_enforced is None: + Slice_enforced_val = None + else: + Slice_enforced_val = self.Slice_enforced.copy() + Nslices_enforced_val = self.Nslices_enforced + type_distribution_enforced_val = self.type_distribution_enforced + is_current_harm_val = self.is_current_harm + T_mag_val = self.T_mag + is_periodicity_rotor_val = self.is_periodicity_rotor + # Creates new object of the same type with the copied properties + obj_copy = type(self)( + subdomain_model=subdomain_model_val, + Nharm_coeff=Nharm_coeff_val, + is_remove_slotS=is_remove_slotS_val, + is_remove_slotR=is_remove_slotR_val, + is_remove_ventS=is_remove_ventS_val, + is_remove_ventR=is_remove_ventR_val, + is_mmfs=is_mmfs_val, + is_mmfr=is_mmfr_val, + type_BH_stator=type_BH_stator_val, + type_BH_rotor=type_BH_rotor_val, + is_periodicity_t=is_periodicity_t_val, + is_periodicity_a=is_periodicity_a_val, + angle_stator_shift=angle_stator_shift_val, + angle_rotor_shift=angle_rotor_shift_val, + logger_name=logger_name_val, + Slice_enforced=Slice_enforced_val, + Nslices_enforced=Nslices_enforced_val, + type_distribution_enforced=type_distribution_enforced_val, + is_current_harm=is_current_harm_val, + T_mag=T_mag_val, + is_periodicity_rotor=is_periodicity_rotor_val, + ) + return obj_copy + + def _set_None(self): + """Set all the properties to None (except pyleecan object)""" + + if self.subdomain_model is not None: + self.subdomain_model._set_None() + self.Nharm_coeff = None + # Set to None the properties inherited from Magnetics + super(MagSDM, self)._set_None() + + def _get_subdomain_model(self): + """getter of subdomain_model""" + return self._subdomain_model + + def _set_subdomain_model(self, value): + """setter of subdomain_model""" + if isinstance(value, str): # Load from file + try: + value = load_init_dict(value)[1] + except Exception as e: + self.get_logger().error( + "Error while loading " + value + ", setting None instead" + ) + value = None + if isinstance(value, dict) and "__class__" in value: + class_obj = import_class( + "pyleecan.Classes", value.get("__class__"), "subdomain_model" + ) + value = class_obj(init_dict=value) + elif type(value) is int and value == -1: # Default constructor + SubdomainModel = import_class( + "pyleecan.Classes", "SubdomainModel", "subdomain_model" + ) + value = SubdomainModel() + check_var("subdomain_model", value, "SubdomainModel") + self._subdomain_model = value + + if self._subdomain_model is not None: + self._subdomain_model.parent = self + + subdomain_model = property( + fget=_get_subdomain_model, + fset=_set_subdomain_model, + doc=u"""The subdomain model object defined to calculate airgap flux density + + :Type: SubdomainModel + """, + ) + + def _get_Nharm_coeff(self): + """getter of Nharm_coeff""" + return self._Nharm_coeff + + def _set_Nharm_coeff(self, value): + """setter of Nharm_coeff""" + check_var("Nharm_coeff", value, "float", Vmin=0) + self._Nharm_coeff = value + + Nharm_coeff = property( + fget=_get_Nharm_coeff, + fset=_set_Nharm_coeff, + doc=u"""Scaling coefficient to calculate more or less harmonics in subdomains + + :Type: float + :min: 0 + """, + ) diff --git a/pyleecan/Classes/Subdomain.py b/pyleecan/Classes/Subdomain.py new file mode 100644 index 000000000..12dcdde43 --- /dev/null +++ b/pyleecan/Classes/Subdomain.py @@ -0,0 +1,275 @@ +# -*- coding: utf-8 -*- +# File generated according to Generator/ClassesRef/Simulation/Subdomain.csv +# WARNING! All changes made in this file will be lost! +"""Method code available at https://github.com/Eomys/pyleecan/tree/master/pyleecan/Methods/Simulation/Subdomain +""" + +from os import linesep +from sys import getsizeof +from logging import getLogger +from ._check import set_array, check_var, raise_ +from ..Functions.get_logger import get_logger +from ..Functions.save import save +from ..Functions.load import load_init_dict +from ..Functions.Load.import_class import import_class +from copy import deepcopy +from ._frozen import FrozenClass + +from numpy import array, array_equal +from numpy import isnan +from ._check import InitUnKnowClassError + + +class Subdomain(FrozenClass): + """Abstract class for all subdomains""" + + VERSION = 1 + + # generic save method is available in all object + save = save + # get_logger method is available in all object + get_logger = get_logger + + def __init__( + self, + k=None, + number=None, + permeability_relative=1, + init_dict=None, + init_str=None, + ): + """Constructor of the class. Can be use in three ways : + - __init__ (arg1 = 1, arg3 = 5) every parameters have name and default values + for pyleecan type, -1 will call the default constructor + - __init__ (init_dict = d) d must be a dictionary with property names as keys + - __init__ (init_str = s) s must be a string + s is the file path to load + + ndarray or list can be given for Vector and Matrix + object or dict can be given for pyleecan Object""" + + if init_str is not None: # Load from a file + init_dict = load_init_dict(init_str)[1] + if init_dict is not None: # Initialisation by dict + assert type(init_dict) is dict + # Overwrite default value with init_dict content + if "k" in list(init_dict.keys()): + k = init_dict["k"] + if "number" in list(init_dict.keys()): + number = init_dict["number"] + if "permeability_relative" in list(init_dict.keys()): + permeability_relative = init_dict["permeability_relative"] + # Set the properties (value check and convertion are done in setter) + self.parent = None + self.k = k + self.number = number + self.permeability_relative = permeability_relative + + # The class is frozen, for now it's impossible to add new properties + self._freeze() + + def __str__(self): + """Convert this object in a readeable string (for print)""" + + Subdomain_str = "" + if self.parent is None: + Subdomain_str += "parent = None " + linesep + else: + Subdomain_str += "parent = " + str(type(self.parent)) + " object" + linesep + Subdomain_str += ( + "k = " + + linesep + + str(self.k).replace(linesep, linesep + "\t") + + linesep + + linesep + ) + Subdomain_str += "number = " + str(self.number) + linesep + Subdomain_str += ( + "permeability_relative = " + str(self.permeability_relative) + linesep + ) + return Subdomain_str + + def __eq__(self, other): + """Compare two objects (skip parent)""" + + if type(other) != type(self): + return False + if not array_equal(other.k, self.k): + return False + if other.number != self.number: + return False + if other.permeability_relative != self.permeability_relative: + return False + return True + + def compare(self, other, name="self", ignore_list=None, is_add_value=False): + """Compare two objects and return list of differences""" + + if ignore_list is None: + ignore_list = list() + if type(other) != type(self): + return ["type(" + name + ")"] + diff_list = list() + if not array_equal(other.k, self.k): + diff_list.append(name + ".k") + if other._number != self._number: + if is_add_value: + val_str = ( + " (self=" + + str(self._number) + + ", other=" + + str(other._number) + + ")" + ) + diff_list.append(name + ".number" + val_str) + else: + diff_list.append(name + ".number") + if ( + other._permeability_relative is not None + and self._permeability_relative is not None + and isnan(other._permeability_relative) + and isnan(self._permeability_relative) + ): + pass + elif other._permeability_relative != self._permeability_relative: + if is_add_value: + val_str = ( + " (self=" + + str(self._permeability_relative) + + ", other=" + + str(other._permeability_relative) + + ")" + ) + diff_list.append(name + ".permeability_relative" + val_str) + else: + diff_list.append(name + ".permeability_relative") + # Filter ignore differences + diff_list = list(filter(lambda x: x not in ignore_list, diff_list)) + return diff_list + + def __sizeof__(self): + """Return the size in memory of the object (including all subobject)""" + + S = 0 # Full size of the object + S += getsizeof(self.k) + S += getsizeof(self.number) + S += getsizeof(self.permeability_relative) + return S + + def as_dict(self, type_handle_ndarray=0, keep_function=False, **kwargs): + """ + Convert this object in a json serializable dict (can be use in __init__). + type_handle_ndarray: int + How to handle ndarray (0: tolist, 1: copy, 2: nothing) + keep_function : bool + True to keep the function object, else return str + Optional keyword input parameter is for internal use only + and may prevent json serializability. + """ + + Subdomain_dict = dict() + if self.k is None: + Subdomain_dict["k"] = None + else: + if type_handle_ndarray == 0: + Subdomain_dict["k"] = self.k.tolist() + elif type_handle_ndarray == 1: + Subdomain_dict["k"] = self.k.copy() + elif type_handle_ndarray == 2: + Subdomain_dict["k"] = self.k + else: + raise Exception( + "Unknown type_handle_ndarray: " + str(type_handle_ndarray) + ) + Subdomain_dict["number"] = self.number + Subdomain_dict["permeability_relative"] = self.permeability_relative + # The class name is added to the dict for deserialisation purpose + Subdomain_dict["__class__"] = "Subdomain" + return Subdomain_dict + + def copy(self): + """Creates a deepcopy of the object""" + + # Handle deepcopy of all the properties + if self.k is None: + k_val = None + else: + k_val = self.k.copy() + number_val = self.number + permeability_relative_val = self.permeability_relative + # Creates new object of the same type with the copied properties + obj_copy = type(self)( + k=k_val, number=number_val, permeability_relative=permeability_relative_val + ) + return obj_copy + + def _set_None(self): + """Set all the properties to None (except pyleecan object)""" + + self.k = None + self.number = None + self.permeability_relative = None + + def _get_k(self): + """getter of k""" + return self._k + + def _set_k(self, value): + """setter of k""" + if type(value) is int and value == -1: + value = array([]) + elif type(value) is list: + try: + value = array(value) + except: + pass + check_var("k", value, "ndarray", Vmin=0) + self._k = value + + k = property( + fget=_get_k, + fset=_set_k, + doc=u"""Array of harmonic numbers + + :Type: ndarray + :min: 0 + """, + ) + + def _get_number(self): + """getter of number""" + return self._number + + def _set_number(self, value): + """setter of number""" + check_var("number", value, "int", Vmin=0) + self._number = value + + number = property( + fget=_get_number, + fset=_set_number, + doc=u"""Number of identical subdomains in model + + :Type: int + :min: 0 + """, + ) + + def _get_permeability_relative(self): + """getter of permeability_relative""" + return self._permeability_relative + + def _set_permeability_relative(self, value): + """setter of permeability_relative""" + check_var("permeability_relative", value, "float", Vmin=1) + self._permeability_relative = value + + permeability_relative = property( + fget=_get_permeability_relative, + fset=_set_permeability_relative, + doc=u"""Relative permeability of subdomain + + :Type: float + :min: 1 + """, + ) diff --git a/pyleecan/Classes/SubdomainModel.py b/pyleecan/Classes/SubdomainModel.py new file mode 100644 index 000000000..7a8a951f8 --- /dev/null +++ b/pyleecan/Classes/SubdomainModel.py @@ -0,0 +1,596 @@ +# -*- coding: utf-8 -*- +# File generated according to Generator/ClassesRef/Simulation/SubdomainModel.csv +# WARNING! All changes made in this file will be lost! +"""Method code available at https://github.com/Eomys/pyleecan/tree/master/pyleecan/Methods/Simulation/SubdomainModel +""" + +from os import linesep +from sys import getsizeof +from logging import getLogger +from ._check import set_array, check_var, raise_ +from ..Functions.get_logger import get_logger +from ..Functions.save import save +from ..Functions.load import load_init_dict +from ..Functions.Load.import_class import import_class +from copy import deepcopy +from ._frozen import FrozenClass + +from numpy import array, array_equal +from numpy import isnan +from ._check import InitUnKnowClassError + + +class SubdomainModel(FrozenClass): + """Abstract class for all the Subdomain model classes""" + + VERSION = 1 + + # generic save method is available in all object + save = save + # get_logger method is available in all object + get_logger = get_logger + + def __init__( + self, + airgap=None, + per_a=None, + machine_polar_eq=None, + is_antiper_a=None, + mat=None, + vect=None, + csts_number=None, + csts_position=None, + init_dict=None, + init_str=None, + ): + """Constructor of the class. Can be use in three ways : + - __init__ (arg1 = 1, arg3 = 5) every parameters have name and default values + for pyleecan type, -1 will call the default constructor + - __init__ (init_dict = d) d must be a dictionary with property names as keys + - __init__ (init_str = s) s must be a string + s is the file path to load + + ndarray or list can be given for Vector and Matrix + object or dict can be given for pyleecan Object""" + + if init_str is not None: # Load from a file + init_dict = load_init_dict(init_str)[1] + if init_dict is not None: # Initialisation by dict + assert type(init_dict) is dict + # Overwrite default value with init_dict content + if "airgap" in list(init_dict.keys()): + airgap = init_dict["airgap"] + if "per_a" in list(init_dict.keys()): + per_a = init_dict["per_a"] + if "machine_polar_eq" in list(init_dict.keys()): + machine_polar_eq = init_dict["machine_polar_eq"] + if "is_antiper_a" in list(init_dict.keys()): + is_antiper_a = init_dict["is_antiper_a"] + if "mat" in list(init_dict.keys()): + mat = init_dict["mat"] + if "vect" in list(init_dict.keys()): + vect = init_dict["vect"] + if "csts_number" in list(init_dict.keys()): + csts_number = init_dict["csts_number"] + if "csts_position" in list(init_dict.keys()): + csts_position = init_dict["csts_position"] + # Set the properties (value check and convertion are done in setter) + self.parent = None + self.airgap = airgap + self.per_a = per_a + self.machine_polar_eq = machine_polar_eq + self.is_antiper_a = is_antiper_a + self.mat = mat + self.vect = vect + self.csts_number = csts_number + self.csts_position = csts_position + + # The class is frozen, for now it's impossible to add new properties + self._freeze() + + def __str__(self): + """Convert this object in a readeable string (for print)""" + + SubdomainModel_str = "" + if self.parent is None: + SubdomainModel_str += "parent = None " + linesep + else: + SubdomainModel_str += ( + "parent = " + str(type(self.parent)) + " object" + linesep + ) + if self.airgap is not None: + tmp = self.airgap.__str__().replace(linesep, linesep + "\t").rstrip("\t") + SubdomainModel_str += "airgap = " + tmp + else: + SubdomainModel_str += "airgap = None" + linesep + linesep + SubdomainModel_str += "per_a = " + str(self.per_a) + linesep + if self.machine_polar_eq is not None: + tmp = ( + self.machine_polar_eq.__str__() + .replace(linesep, linesep + "\t") + .rstrip("\t") + ) + SubdomainModel_str += "machine_polar_eq = " + tmp + else: + SubdomainModel_str += "machine_polar_eq = None" + linesep + linesep + SubdomainModel_str += "is_antiper_a = " + str(self.is_antiper_a) + linesep + SubdomainModel_str += ( + "mat = " + + linesep + + str(self.mat).replace(linesep, linesep + "\t") + + linesep + + linesep + ) + SubdomainModel_str += ( + "vect = " + + linesep + + str(self.vect).replace(linesep, linesep + "\t") + + linesep + + linesep + ) + SubdomainModel_str += ( + "csts_number = " + + linesep + + str(self.csts_number).replace(linesep, linesep + "\t") + + linesep + ) + SubdomainModel_str += ( + "csts_position = " + + linesep + + str(self.csts_position).replace(linesep, linesep + "\t") + + linesep + ) + return SubdomainModel_str + + def __eq__(self, other): + """Compare two objects (skip parent)""" + + if type(other) != type(self): + return False + if other.airgap != self.airgap: + return False + if other.per_a != self.per_a: + return False + if other.machine_polar_eq != self.machine_polar_eq: + return False + if other.is_antiper_a != self.is_antiper_a: + return False + if not array_equal(other.mat, self.mat): + return False + if not array_equal(other.vect, self.vect): + return False + if other.csts_number != self.csts_number: + return False + if other.csts_position != self.csts_position: + return False + return True + + def compare(self, other, name="self", ignore_list=None, is_add_value=False): + """Compare two objects and return list of differences""" + + if ignore_list is None: + ignore_list = list() + if type(other) != type(self): + return ["type(" + name + ")"] + diff_list = list() + if (other.airgap is None and self.airgap is not None) or ( + other.airgap is not None and self.airgap is None + ): + diff_list.append(name + ".airgap None mismatch") + elif self.airgap is not None: + diff_list.extend( + self.airgap.compare( + other.airgap, + name=name + ".airgap", + ignore_list=ignore_list, + is_add_value=is_add_value, + ) + ) + if other._per_a != self._per_a: + if is_add_value: + val_str = ( + " (self=" + str(self._per_a) + ", other=" + str(other._per_a) + ")" + ) + diff_list.append(name + ".per_a" + val_str) + else: + diff_list.append(name + ".per_a") + if (other.machine_polar_eq is None and self.machine_polar_eq is not None) or ( + other.machine_polar_eq is not None and self.machine_polar_eq is None + ): + diff_list.append(name + ".machine_polar_eq None mismatch") + elif self.machine_polar_eq is not None: + diff_list.extend( + self.machine_polar_eq.compare( + other.machine_polar_eq, + name=name + ".machine_polar_eq", + ignore_list=ignore_list, + is_add_value=is_add_value, + ) + ) + if other._is_antiper_a != self._is_antiper_a: + if is_add_value: + val_str = ( + " (self=" + + str(self._is_antiper_a) + + ", other=" + + str(other._is_antiper_a) + + ")" + ) + diff_list.append(name + ".is_antiper_a" + val_str) + else: + diff_list.append(name + ".is_antiper_a") + if not array_equal(other.mat, self.mat): + diff_list.append(name + ".mat") + if not array_equal(other.vect, self.vect): + diff_list.append(name + ".vect") + if other._csts_number != self._csts_number: + if is_add_value: + val_str = ( + " (self=" + + str(self._csts_number) + + ", other=" + + str(other._csts_number) + + ")" + ) + diff_list.append(name + ".csts_number" + val_str) + else: + diff_list.append(name + ".csts_number") + if other._csts_position != self._csts_position: + if is_add_value: + val_str = ( + " (self=" + + str(self._csts_position) + + ", other=" + + str(other._csts_position) + + ")" + ) + diff_list.append(name + ".csts_position" + val_str) + else: + diff_list.append(name + ".csts_position") + # Filter ignore differences + diff_list = list(filter(lambda x: x not in ignore_list, diff_list)) + return diff_list + + def __sizeof__(self): + """Return the size in memory of the object (including all subobject)""" + + S = 0 # Full size of the object + S += getsizeof(self.airgap) + S += getsizeof(self.per_a) + S += getsizeof(self.machine_polar_eq) + S += getsizeof(self.is_antiper_a) + S += getsizeof(self.mat) + S += getsizeof(self.vect) + if self.csts_number is not None: + for value in self.csts_number: + S += getsizeof(value) + if self.csts_position is not None: + for value in self.csts_position: + S += getsizeof(value) + return S + + def as_dict(self, type_handle_ndarray=0, keep_function=False, **kwargs): + """ + Convert this object in a json serializable dict (can be use in __init__). + type_handle_ndarray: int + How to handle ndarray (0: tolist, 1: copy, 2: nothing) + keep_function : bool + True to keep the function object, else return str + Optional keyword input parameter is for internal use only + and may prevent json serializability. + """ + + SubdomainModel_dict = dict() + if self.airgap is None: + SubdomainModel_dict["airgap"] = None + else: + SubdomainModel_dict["airgap"] = self.airgap.as_dict( + type_handle_ndarray=type_handle_ndarray, + keep_function=keep_function, + **kwargs + ) + SubdomainModel_dict["per_a"] = self.per_a + if self.machine_polar_eq is None: + SubdomainModel_dict["machine_polar_eq"] = None + else: + SubdomainModel_dict["machine_polar_eq"] = self.machine_polar_eq.as_dict( + type_handle_ndarray=type_handle_ndarray, + keep_function=keep_function, + **kwargs + ) + SubdomainModel_dict["is_antiper_a"] = self.is_antiper_a + if self.mat is None: + SubdomainModel_dict["mat"] = None + else: + if type_handle_ndarray == 0: + SubdomainModel_dict["mat"] = self.mat.tolist() + elif type_handle_ndarray == 1: + SubdomainModel_dict["mat"] = self.mat.copy() + elif type_handle_ndarray == 2: + SubdomainModel_dict["mat"] = self.mat + else: + raise Exception( + "Unknown type_handle_ndarray: " + str(type_handle_ndarray) + ) + if self.vect is None: + SubdomainModel_dict["vect"] = None + else: + if type_handle_ndarray == 0: + SubdomainModel_dict["vect"] = self.vect.tolist() + elif type_handle_ndarray == 1: + SubdomainModel_dict["vect"] = self.vect.copy() + elif type_handle_ndarray == 2: + SubdomainModel_dict["vect"] = self.vect + else: + raise Exception( + "Unknown type_handle_ndarray: " + str(type_handle_ndarray) + ) + SubdomainModel_dict["csts_number"] = ( + self.csts_number.copy() if self.csts_number is not None else None + ) + SubdomainModel_dict["csts_position"] = ( + self.csts_position.copy() if self.csts_position is not None else None + ) + # The class name is added to the dict for deserialisation purpose + SubdomainModel_dict["__class__"] = "SubdomainModel" + return SubdomainModel_dict + + def copy(self): + """Creates a deepcopy of the object""" + + # Handle deepcopy of all the properties + if self.airgap is None: + airgap_val = None + else: + airgap_val = self.airgap.copy() + per_a_val = self.per_a + if self.machine_polar_eq is None: + machine_polar_eq_val = None + else: + machine_polar_eq_val = self.machine_polar_eq.copy() + is_antiper_a_val = self.is_antiper_a + if self.mat is None: + mat_val = None + else: + mat_val = self.mat.copy() + if self.vect is None: + vect_val = None + else: + vect_val = self.vect.copy() + if self.csts_number is None: + csts_number_val = None + else: + csts_number_val = self.csts_number.copy() + if self.csts_position is None: + csts_position_val = None + else: + csts_position_val = self.csts_position.copy() + # Creates new object of the same type with the copied properties + obj_copy = type(self)( + airgap=airgap_val, + per_a=per_a_val, + machine_polar_eq=machine_polar_eq_val, + is_antiper_a=is_antiper_a_val, + mat=mat_val, + vect=vect_val, + csts_number=csts_number_val, + csts_position=csts_position_val, + ) + return obj_copy + + def _set_None(self): + """Set all the properties to None (except pyleecan object)""" + + if self.airgap is not None: + self.airgap._set_None() + self.per_a = None + if self.machine_polar_eq is not None: + self.machine_polar_eq._set_None() + self.is_antiper_a = None + self.mat = None + self.vect = None + self.csts_number = None + self.csts_position = None + + def _get_airgap(self): + """getter of airgap""" + return self._airgap + + def _set_airgap(self, value): + """setter of airgap""" + if isinstance(value, str): # Load from file + try: + value = load_init_dict(value)[1] + except Exception as e: + self.get_logger().error( + "Error while loading " + value + ", setting None instead" + ) + value = None + if isinstance(value, dict) and "__class__" in value: + class_obj = import_class( + "pyleecan.Classes", value.get("__class__"), "airgap" + ) + value = class_obj(init_dict=value) + elif type(value) is int and value == -1: # Default constructor + Subdomain_Airgap = import_class( + "pyleecan.Classes", "Subdomain_Airgap", "airgap" + ) + value = Subdomain_Airgap() + check_var("airgap", value, "Subdomain_Airgap") + self._airgap = value + + if self._airgap is not None: + self._airgap.parent = self + + airgap = property( + fget=_get_airgap, + fset=_set_airgap, + doc=u"""Airgap subdomain + + :Type: Subdomain_Airgap + """, + ) + + def _get_per_a(self): + """getter of per_a""" + return self._per_a + + def _set_per_a(self, value): + """setter of per_a""" + check_var("per_a", value, "int", Vmin=1) + self._per_a = value + + per_a = property( + fget=_get_per_a, + fset=_set_per_a, + doc=u"""Spatial periodicity factor + + :Type: int + :min: 1 + """, + ) + + def _get_machine_polar_eq(self): + """getter of machine_polar_eq""" + return self._machine_polar_eq + + def _set_machine_polar_eq(self, value): + """setter of machine_polar_eq""" + if isinstance(value, str): # Load from file + try: + value = load_init_dict(value)[1] + except Exception as e: + self.get_logger().error( + "Error while loading " + value + ", setting None instead" + ) + value = None + if isinstance(value, dict) and "__class__" in value: + class_obj = import_class( + "pyleecan.Classes", value.get("__class__"), "machine_polar_eq" + ) + value = class_obj(init_dict=value) + elif type(value) is int and value == -1: # Default constructor + Machine = import_class("pyleecan.Classes", "Machine", "machine_polar_eq") + value = Machine() + check_var("machine_polar_eq", value, "Machine") + self._machine_polar_eq = value + + if self._machine_polar_eq is not None: + self._machine_polar_eq.parent = self + + machine_polar_eq = property( + fget=_get_machine_polar_eq, + fset=_set_machine_polar_eq, + doc=u"""Polar equivalent of machine + + :Type: Machine + """, + ) + + def _get_is_antiper_a(self): + """getter of is_antiper_a""" + return self._is_antiper_a + + def _set_is_antiper_a(self, value): + """setter of is_antiper_a""" + check_var("is_antiper_a", value, "bool") + self._is_antiper_a = value + + is_antiper_a = property( + fget=_get_is_antiper_a, + fset=_set_is_antiper_a, + doc=u"""True if there is spatial anti-periodicity + + :Type: bool + """, + ) + + def _get_mat(self): + """getter of mat""" + return self._mat + + def _set_mat(self, value): + """setter of mat""" + if type(value) is int and value == -1: + value = array([]) + elif type(value) is list: + try: + value = array(value) + except: + pass + check_var("mat", value, "ndarray") + self._mat = value + + mat = property( + fget=_get_mat, + fset=_set_mat, + doc=u"""Topological matrix + + :Type: ndarray + """, + ) + + def _get_vect(self): + """getter of vect""" + return self._vect + + def _set_vect(self, value): + """setter of vect""" + if type(value) is int and value == -1: + value = array([]) + elif type(value) is list: + try: + value = array(value) + except: + pass + check_var("vect", value, "ndarray") + self._vect = value + + vect = property( + fget=_get_vect, + fset=_set_vect, + doc=u"""Source vector + + :Type: ndarray + """, + ) + + def _get_csts_number(self): + """getter of csts_number""" + return self._csts_number + + def _set_csts_number(self, value): + """setter of csts_number""" + if type(value) is int and value == -1: + value = list() + check_var("csts_number", value, "list") + self._csts_number = value + + csts_number = property( + fget=_get_csts_number, + fset=_set_csts_number, + doc=u"""List of constants number + + :Type: list + """, + ) + + def _get_csts_position(self): + """getter of csts_position""" + return self._csts_position + + def _set_csts_position(self, value): + """setter of csts_position""" + if type(value) is int and value == -1: + value = list() + check_var("csts_position", value, "list") + self._csts_position = value + + csts_position = property( + fget=_get_csts_position, + fset=_set_csts_position, + doc=u"""List of constants positions in topoligical matrix + + :Type: list + """, + ) diff --git a/pyleecan/Classes/SubdomainModel_SPMSM.py b/pyleecan/Classes/SubdomainModel_SPMSM.py new file mode 100644 index 000000000..50554af72 --- /dev/null +++ b/pyleecan/Classes/SubdomainModel_SPMSM.py @@ -0,0 +1,513 @@ +# -*- coding: utf-8 -*- +# File generated according to Generator/ClassesRef/Simulation/SubdomainModel_SPMSM.csv +# WARNING! All changes made in this file will be lost! +"""Method code available at https://github.com/Eomys/pyleecan/tree/master/pyleecan/Methods/Simulation/SubdomainModel_SPMSM +""" + +from os import linesep +from sys import getsizeof +from logging import getLogger +from ._check import set_array, check_var, raise_ +from ..Functions.get_logger import get_logger +from ..Functions.save import save +from ..Functions.load import load_init_dict +from ..Functions.Load.import_class import import_class +from copy import deepcopy +from .SubdomainModel import SubdomainModel + +# Import all class method +# Try/catch to remove unnecessary dependencies in unused method +try: + from ..Methods.Simulation.SubdomainModel_SPMSM.set_subdomains import set_subdomains +except ImportError as error: + set_subdomains = error + +try: + from ..Methods.Simulation.SubdomainModel_SPMSM.solve import solve +except ImportError as error: + solve = error + +try: + from ..Methods.Simulation.SubdomainModel_SPMSM.store_constants import ( + store_constants, + ) +except ImportError as error: + store_constants = error + + +from numpy import array, array_equal +from numpy import isnan +from ._check import InitUnKnowClassError + + +class SubdomainModel_SPMSM(SubdomainModel): + """Subdomain model for Surface Permanent Magnet Synchronous Machine assuming infinite permeability in yokes""" + + VERSION = 1 + + # Check ImportError to remove unnecessary dependencies in unused method + # cf Methods.Simulation.SubdomainModel_SPMSM.set_subdomains + if isinstance(set_subdomains, ImportError): + set_subdomains = property( + fget=lambda x: raise_( + ImportError( + "Can't use SubdomainModel_SPMSM method set_subdomains: " + + str(set_subdomains) + ) + ) + ) + else: + set_subdomains = set_subdomains + # cf Methods.Simulation.SubdomainModel_SPMSM.solve + if isinstance(solve, ImportError): + solve = property( + fget=lambda x: raise_( + ImportError( + "Can't use SubdomainModel_SPMSM method solve: " + str(solve) + ) + ) + ) + else: + solve = solve + # cf Methods.Simulation.SubdomainModel_SPMSM.store_constants + if isinstance(store_constants, ImportError): + store_constants = property( + fget=lambda x: raise_( + ImportError( + "Can't use SubdomainModel_SPMSM method store_constants: " + + str(store_constants) + ) + ) + ) + else: + store_constants = store_constants + # generic save method is available in all object + save = save + # get_logger method is available in all object + get_logger = get_logger + + def __init__( + self, + stator_slot=None, + rotor_magnet_surface=None, + rotor_yoke=None, + airgap=None, + per_a=None, + machine_polar_eq=None, + is_antiper_a=None, + mat=None, + vect=None, + csts_number=None, + csts_position=None, + init_dict=None, + init_str=None, + ): + """Constructor of the class. Can be use in three ways : + - __init__ (arg1 = 1, arg3 = 5) every parameters have name and default values + for pyleecan type, -1 will call the default constructor + - __init__ (init_dict = d) d must be a dictionary with property names as keys + - __init__ (init_str = s) s must be a string + s is the file path to load + + ndarray or list can be given for Vector and Matrix + object or dict can be given for pyleecan Object""" + + if init_str is not None: # Load from a file + init_dict = load_init_dict(init_str)[1] + if init_dict is not None: # Initialisation by dict + assert type(init_dict) is dict + # Overwrite default value with init_dict content + if "stator_slot" in list(init_dict.keys()): + stator_slot = init_dict["stator_slot"] + if "rotor_magnet_surface" in list(init_dict.keys()): + rotor_magnet_surface = init_dict["rotor_magnet_surface"] + if "rotor_yoke" in list(init_dict.keys()): + rotor_yoke = init_dict["rotor_yoke"] + if "airgap" in list(init_dict.keys()): + airgap = init_dict["airgap"] + if "per_a" in list(init_dict.keys()): + per_a = init_dict["per_a"] + if "machine_polar_eq" in list(init_dict.keys()): + machine_polar_eq = init_dict["machine_polar_eq"] + if "is_antiper_a" in list(init_dict.keys()): + is_antiper_a = init_dict["is_antiper_a"] + if "mat" in list(init_dict.keys()): + mat = init_dict["mat"] + if "vect" in list(init_dict.keys()): + vect = init_dict["vect"] + if "csts_number" in list(init_dict.keys()): + csts_number = init_dict["csts_number"] + if "csts_position" in list(init_dict.keys()): + csts_position = init_dict["csts_position"] + # Set the properties (value check and convertion are done in setter) + self.stator_slot = stator_slot + self.rotor_magnet_surface = rotor_magnet_surface + self.rotor_yoke = rotor_yoke + # Call SubdomainModel init + super(SubdomainModel_SPMSM, self).__init__( + airgap=airgap, + per_a=per_a, + machine_polar_eq=machine_polar_eq, + is_antiper_a=is_antiper_a, + mat=mat, + vect=vect, + csts_number=csts_number, + csts_position=csts_position, + ) + # The class is frozen (in SubdomainModel init), for now it's impossible to + # add new properties + + def __str__(self): + """Convert this object in a readeable string (for print)""" + + SubdomainModel_SPMSM_str = "" + # Get the properties inherited from SubdomainModel + SubdomainModel_SPMSM_str += super(SubdomainModel_SPMSM, self).__str__() + if self.stator_slot is not None: + tmp = ( + self.stator_slot.__str__().replace(linesep, linesep + "\t").rstrip("\t") + ) + SubdomainModel_SPMSM_str += "stator_slot = " + tmp + else: + SubdomainModel_SPMSM_str += "stator_slot = None" + linesep + linesep + if self.rotor_magnet_surface is not None: + tmp = ( + self.rotor_magnet_surface.__str__() + .replace(linesep, linesep + "\t") + .rstrip("\t") + ) + SubdomainModel_SPMSM_str += "rotor_magnet_surface = " + tmp + else: + SubdomainModel_SPMSM_str += ( + "rotor_magnet_surface = None" + linesep + linesep + ) + if self.rotor_yoke is not None: + tmp = ( + self.rotor_yoke.__str__().replace(linesep, linesep + "\t").rstrip("\t") + ) + SubdomainModel_SPMSM_str += "rotor_yoke = " + tmp + else: + SubdomainModel_SPMSM_str += "rotor_yoke = None" + linesep + linesep + return SubdomainModel_SPMSM_str + + def __eq__(self, other): + """Compare two objects (skip parent)""" + + if type(other) != type(self): + return False + + # Check the properties inherited from SubdomainModel + if not super(SubdomainModel_SPMSM, self).__eq__(other): + return False + if other.stator_slot != self.stator_slot: + return False + if other.rotor_magnet_surface != self.rotor_magnet_surface: + return False + if other.rotor_yoke != self.rotor_yoke: + return False + return True + + def compare(self, other, name="self", ignore_list=None, is_add_value=False): + """Compare two objects and return list of differences""" + + if ignore_list is None: + ignore_list = list() + if type(other) != type(self): + return ["type(" + name + ")"] + diff_list = list() + + # Check the properties inherited from SubdomainModel + diff_list.extend( + super(SubdomainModel_SPMSM, self).compare( + other, name=name, ignore_list=ignore_list, is_add_value=is_add_value + ) + ) + if (other.stator_slot is None and self.stator_slot is not None) or ( + other.stator_slot is not None and self.stator_slot is None + ): + diff_list.append(name + ".stator_slot None mismatch") + elif self.stator_slot is not None: + diff_list.extend( + self.stator_slot.compare( + other.stator_slot, + name=name + ".stator_slot", + ignore_list=ignore_list, + is_add_value=is_add_value, + ) + ) + if ( + other.rotor_magnet_surface is None and self.rotor_magnet_surface is not None + ) or ( + other.rotor_magnet_surface is not None and self.rotor_magnet_surface is None + ): + diff_list.append(name + ".rotor_magnet_surface None mismatch") + elif self.rotor_magnet_surface is not None: + diff_list.extend( + self.rotor_magnet_surface.compare( + other.rotor_magnet_surface, + name=name + ".rotor_magnet_surface", + ignore_list=ignore_list, + is_add_value=is_add_value, + ) + ) + if (other.rotor_yoke is None and self.rotor_yoke is not None) or ( + other.rotor_yoke is not None and self.rotor_yoke is None + ): + diff_list.append(name + ".rotor_yoke None mismatch") + elif self.rotor_yoke is not None: + diff_list.extend( + self.rotor_yoke.compare( + other.rotor_yoke, + name=name + ".rotor_yoke", + ignore_list=ignore_list, + is_add_value=is_add_value, + ) + ) + # Filter ignore differences + diff_list = list(filter(lambda x: x not in ignore_list, diff_list)) + return diff_list + + def __sizeof__(self): + """Return the size in memory of the object (including all subobject)""" + + S = 0 # Full size of the object + + # Get size of the properties inherited from SubdomainModel + S += super(SubdomainModel_SPMSM, self).__sizeof__() + S += getsizeof(self.stator_slot) + S += getsizeof(self.rotor_magnet_surface) + S += getsizeof(self.rotor_yoke) + return S + + def as_dict(self, type_handle_ndarray=0, keep_function=False, **kwargs): + """ + Convert this object in a json serializable dict (can be use in __init__). + type_handle_ndarray: int + How to handle ndarray (0: tolist, 1: copy, 2: nothing) + keep_function : bool + True to keep the function object, else return str + Optional keyword input parameter is for internal use only + and may prevent json serializability. + """ + + # Get the properties inherited from SubdomainModel + SubdomainModel_SPMSM_dict = super(SubdomainModel_SPMSM, self).as_dict( + type_handle_ndarray=type_handle_ndarray, + keep_function=keep_function, + **kwargs + ) + if self.stator_slot is None: + SubdomainModel_SPMSM_dict["stator_slot"] = None + else: + SubdomainModel_SPMSM_dict["stator_slot"] = self.stator_slot.as_dict( + type_handle_ndarray=type_handle_ndarray, + keep_function=keep_function, + **kwargs + ) + if self.rotor_magnet_surface is None: + SubdomainModel_SPMSM_dict["rotor_magnet_surface"] = None + else: + SubdomainModel_SPMSM_dict[ + "rotor_magnet_surface" + ] = self.rotor_magnet_surface.as_dict( + type_handle_ndarray=type_handle_ndarray, + keep_function=keep_function, + **kwargs + ) + if self.rotor_yoke is None: + SubdomainModel_SPMSM_dict["rotor_yoke"] = None + else: + SubdomainModel_SPMSM_dict["rotor_yoke"] = self.rotor_yoke.as_dict( + type_handle_ndarray=type_handle_ndarray, + keep_function=keep_function, + **kwargs + ) + # The class name is added to the dict for deserialisation purpose + # Overwrite the mother class name + SubdomainModel_SPMSM_dict["__class__"] = "SubdomainModel_SPMSM" + return SubdomainModel_SPMSM_dict + + def copy(self): + """Creates a deepcopy of the object""" + + # Handle deepcopy of all the properties + if self.stator_slot is None: + stator_slot_val = None + else: + stator_slot_val = self.stator_slot.copy() + if self.rotor_magnet_surface is None: + rotor_magnet_surface_val = None + else: + rotor_magnet_surface_val = self.rotor_magnet_surface.copy() + if self.rotor_yoke is None: + rotor_yoke_val = None + else: + rotor_yoke_val = self.rotor_yoke.copy() + if self.airgap is None: + airgap_val = None + else: + airgap_val = self.airgap.copy() + per_a_val = self.per_a + if self.machine_polar_eq is None: + machine_polar_eq_val = None + else: + machine_polar_eq_val = self.machine_polar_eq.copy() + is_antiper_a_val = self.is_antiper_a + if self.mat is None: + mat_val = None + else: + mat_val = self.mat.copy() + if self.vect is None: + vect_val = None + else: + vect_val = self.vect.copy() + if self.csts_number is None: + csts_number_val = None + else: + csts_number_val = self.csts_number.copy() + if self.csts_position is None: + csts_position_val = None + else: + csts_position_val = self.csts_position.copy() + # Creates new object of the same type with the copied properties + obj_copy = type(self)( + stator_slot=stator_slot_val, + rotor_magnet_surface=rotor_magnet_surface_val, + rotor_yoke=rotor_yoke_val, + airgap=airgap_val, + per_a=per_a_val, + machine_polar_eq=machine_polar_eq_val, + is_antiper_a=is_antiper_a_val, + mat=mat_val, + vect=vect_val, + csts_number=csts_number_val, + csts_position=csts_position_val, + ) + return obj_copy + + def _set_None(self): + """Set all the properties to None (except pyleecan object)""" + + if self.stator_slot is not None: + self.stator_slot._set_None() + if self.rotor_magnet_surface is not None: + self.rotor_magnet_surface._set_None() + if self.rotor_yoke is not None: + self.rotor_yoke._set_None() + # Set to None the properties inherited from SubdomainModel + super(SubdomainModel_SPMSM, self)._set_None() + + def _get_stator_slot(self): + """getter of stator_slot""" + return self._stator_slot + + def _set_stator_slot(self, value): + """setter of stator_slot""" + if isinstance(value, str): # Load from file + try: + value = load_init_dict(value)[1] + except Exception as e: + self.get_logger().error( + "Error while loading " + value + ", setting None instead" + ) + value = None + if isinstance(value, dict) and "__class__" in value: + class_obj = import_class( + "pyleecan.Classes", value.get("__class__"), "stator_slot" + ) + value = class_obj(init_dict=value) + elif type(value) is int and value == -1: # Default constructor + Subdomain_Slot = import_class( + "pyleecan.Classes", "Subdomain_Slot", "stator_slot" + ) + value = Subdomain_Slot() + check_var("stator_slot", value, "Subdomain_Slot") + self._stator_slot = value + + if self._stator_slot is not None: + self._stator_slot.parent = self + + stator_slot = property( + fget=_get_stator_slot, + fset=_set_stator_slot, + doc=u"""Subdomain for stator slots + + :Type: Subdomain_Slot + """, + ) + + def _get_rotor_magnet_surface(self): + """getter of rotor_magnet_surface""" + return self._rotor_magnet_surface + + def _set_rotor_magnet_surface(self, value): + """setter of rotor_magnet_surface""" + if isinstance(value, str): # Load from file + try: + value = load_init_dict(value)[1] + except Exception as e: + self.get_logger().error( + "Error while loading " + value + ", setting None instead" + ) + value = None + if isinstance(value, dict) and "__class__" in value: + class_obj = import_class( + "pyleecan.Classes", value.get("__class__"), "rotor_magnet_surface" + ) + value = class_obj(init_dict=value) + elif type(value) is int and value == -1: # Default constructor + Subdomain_MagnetSurface = import_class( + "pyleecan.Classes", "Subdomain_MagnetSurface", "rotor_magnet_surface" + ) + value = Subdomain_MagnetSurface() + check_var("rotor_magnet_surface", value, "Subdomain_MagnetSurface") + self._rotor_magnet_surface = value + + if self._rotor_magnet_surface is not None: + self._rotor_magnet_surface.parent = self + + rotor_magnet_surface = property( + fget=_get_rotor_magnet_surface, + fset=_set_rotor_magnet_surface, + doc=u"""Subdomain for surface magnets + + :Type: Subdomain_MagnetSurface + """, + ) + + def _get_rotor_yoke(self): + """getter of rotor_yoke""" + return self._rotor_yoke + + def _set_rotor_yoke(self, value): + """setter of rotor_yoke""" + if isinstance(value, str): # Load from file + try: + value = load_init_dict(value)[1] + except Exception as e: + self.get_logger().error( + "Error while loading " + value + ", setting None instead" + ) + value = None + if isinstance(value, dict) and "__class__" in value: + class_obj = import_class( + "pyleecan.Classes", value.get("__class__"), "rotor_yoke" + ) + value = class_obj(init_dict=value) + elif type(value) is int and value == -1: # Default constructor + Subdomain = import_class("pyleecan.Classes", "Subdomain", "rotor_yoke") + value = Subdomain() + check_var("rotor_yoke", value, "Subdomain") + self._rotor_yoke = value + + if self._rotor_yoke is not None: + self._rotor_yoke.parent = self + + rotor_yoke = property( + fget=_get_rotor_yoke, + fset=_set_rotor_yoke, + doc=u"""Subdomain for rotor yoke + + :Type: Subdomain + """, + ) diff --git a/pyleecan/Classes/Subdomain_Airgap.py b/pyleecan/Classes/Subdomain_Airgap.py new file mode 100644 index 000000000..fd030f4b9 --- /dev/null +++ b/pyleecan/Classes/Subdomain_Airgap.py @@ -0,0 +1,549 @@ +# -*- coding: utf-8 -*- +# File generated according to Generator/ClassesRef/Simulation/Subdomain_Airgap.csv +# WARNING! All changes made in this file will be lost! +"""Method code available at https://github.com/Eomys/pyleecan/tree/master/pyleecan/Methods/Simulation/Subdomain_Airgap +""" + +from os import linesep +from sys import getsizeof +from logging import getLogger +from ._check import set_array, check_var, raise_ +from ..Functions.get_logger import get_logger +from ..Functions.save import save +from ..Functions.load import load_init_dict +from ..Functions.Load.import_class import import_class +from copy import deepcopy +from .Subdomain import Subdomain + +# Import all class method +# Try/catch to remove unnecessary dependencies in unused method +try: + from ..Methods.Simulation.Subdomain_Airgap.add_constants_numbers import ( + add_constants_numbers, + ) +except ImportError as error: + add_constants_numbers = error + +try: + from ..Methods.Simulation.Subdomain_Airgap.comp_flux_density import ( + comp_flux_density, + ) +except ImportError as error: + comp_flux_density = error + +try: + from ..Methods.Simulation.Subdomain_Airgap.comp_torque import comp_torque +except ImportError as error: + comp_torque = error + + +from numpy import array, array_equal +from numpy import isnan +from ._check import InitUnKnowClassError + + +class Subdomain_Airgap(Subdomain): + """Subdomain class for airgap region""" + + VERSION = 1 + + # Check ImportError to remove unnecessary dependencies in unused method + # cf Methods.Simulation.Subdomain_Airgap.add_constants_numbers + if isinstance(add_constants_numbers, ImportError): + add_constants_numbers = property( + fget=lambda x: raise_( + ImportError( + "Can't use Subdomain_Airgap method add_constants_numbers: " + + str(add_constants_numbers) + ) + ) + ) + else: + add_constants_numbers = add_constants_numbers + # cf Methods.Simulation.Subdomain_Airgap.comp_flux_density + if isinstance(comp_flux_density, ImportError): + comp_flux_density = property( + fget=lambda x: raise_( + ImportError( + "Can't use Subdomain_Airgap method comp_flux_density: " + + str(comp_flux_density) + ) + ) + ) + else: + comp_flux_density = comp_flux_density + # cf Methods.Simulation.Subdomain_Airgap.comp_torque + if isinstance(comp_torque, ImportError): + comp_torque = property( + fget=lambda x: raise_( + ImportError( + "Can't use Subdomain_Airgap method comp_torque: " + str(comp_torque) + ) + ) + ) + else: + comp_torque = comp_torque + # generic save method is available in all object + save = save + # get_logger method is available in all object + get_logger = get_logger + + def __init__( + self, + A=None, + B=None, + C=None, + D=None, + Rrbo=None, + Rsbo=None, + k=None, + number=None, + permeability_relative=1, + init_dict=None, + init_str=None, + ): + """Constructor of the class. Can be use in three ways : + - __init__ (arg1 = 1, arg3 = 5) every parameters have name and default values + for pyleecan type, -1 will call the default constructor + - __init__ (init_dict = d) d must be a dictionary with property names as keys + - __init__ (init_str = s) s must be a string + s is the file path to load + + ndarray or list can be given for Vector and Matrix + object or dict can be given for pyleecan Object""" + + if init_str is not None: # Load from a file + init_dict = load_init_dict(init_str)[1] + if init_dict is not None: # Initialisation by dict + assert type(init_dict) is dict + # Overwrite default value with init_dict content + if "A" in list(init_dict.keys()): + A = init_dict["A"] + if "B" in list(init_dict.keys()): + B = init_dict["B"] + if "C" in list(init_dict.keys()): + C = init_dict["C"] + if "D" in list(init_dict.keys()): + D = init_dict["D"] + if "Rrbo" in list(init_dict.keys()): + Rrbo = init_dict["Rrbo"] + if "Rsbo" in list(init_dict.keys()): + Rsbo = init_dict["Rsbo"] + if "k" in list(init_dict.keys()): + k = init_dict["k"] + if "number" in list(init_dict.keys()): + number = init_dict["number"] + if "permeability_relative" in list(init_dict.keys()): + permeability_relative = init_dict["permeability_relative"] + # Set the properties (value check and convertion are done in setter) + self.A = A + self.B = B + self.C = C + self.D = D + self.Rrbo = Rrbo + self.Rsbo = Rsbo + # Call Subdomain init + super(Subdomain_Airgap, self).__init__( + k=k, number=number, permeability_relative=permeability_relative + ) + # The class is frozen (in Subdomain init), for now it's impossible to + # add new properties + + def __str__(self): + """Convert this object in a readeable string (for print)""" + + Subdomain_Airgap_str = "" + # Get the properties inherited from Subdomain + Subdomain_Airgap_str += super(Subdomain_Airgap, self).__str__() + Subdomain_Airgap_str += ( + "A = " + + linesep + + str(self.A).replace(linesep, linesep + "\t") + + linesep + + linesep + ) + Subdomain_Airgap_str += ( + "B = " + + linesep + + str(self.B).replace(linesep, linesep + "\t") + + linesep + + linesep + ) + Subdomain_Airgap_str += ( + "C = " + + linesep + + str(self.C).replace(linesep, linesep + "\t") + + linesep + + linesep + ) + Subdomain_Airgap_str += ( + "D = " + + linesep + + str(self.D).replace(linesep, linesep + "\t") + + linesep + + linesep + ) + Subdomain_Airgap_str += "Rrbo = " + str(self.Rrbo) + linesep + Subdomain_Airgap_str += "Rsbo = " + str(self.Rsbo) + linesep + return Subdomain_Airgap_str + + def __eq__(self, other): + """Compare two objects (skip parent)""" + + if type(other) != type(self): + return False + + # Check the properties inherited from Subdomain + if not super(Subdomain_Airgap, self).__eq__(other): + return False + if not array_equal(other.A, self.A): + return False + if not array_equal(other.B, self.B): + return False + if not array_equal(other.C, self.C): + return False + if not array_equal(other.D, self.D): + return False + if other.Rrbo != self.Rrbo: + return False + if other.Rsbo != self.Rsbo: + return False + return True + + def compare(self, other, name="self", ignore_list=None, is_add_value=False): + """Compare two objects and return list of differences""" + + if ignore_list is None: + ignore_list = list() + if type(other) != type(self): + return ["type(" + name + ")"] + diff_list = list() + + # Check the properties inherited from Subdomain + diff_list.extend( + super(Subdomain_Airgap, self).compare( + other, name=name, ignore_list=ignore_list, is_add_value=is_add_value + ) + ) + if not array_equal(other.A, self.A): + diff_list.append(name + ".A") + if not array_equal(other.B, self.B): + diff_list.append(name + ".B") + if not array_equal(other.C, self.C): + diff_list.append(name + ".C") + if not array_equal(other.D, self.D): + diff_list.append(name + ".D") + if ( + other._Rrbo is not None + and self._Rrbo is not None + and isnan(other._Rrbo) + and isnan(self._Rrbo) + ): + pass + elif other._Rrbo != self._Rrbo: + if is_add_value: + val_str = ( + " (self=" + str(self._Rrbo) + ", other=" + str(other._Rrbo) + ")" + ) + diff_list.append(name + ".Rrbo" + val_str) + else: + diff_list.append(name + ".Rrbo") + if ( + other._Rsbo is not None + and self._Rsbo is not None + and isnan(other._Rsbo) + and isnan(self._Rsbo) + ): + pass + elif other._Rsbo != self._Rsbo: + if is_add_value: + val_str = ( + " (self=" + str(self._Rsbo) + ", other=" + str(other._Rsbo) + ")" + ) + diff_list.append(name + ".Rsbo" + val_str) + else: + diff_list.append(name + ".Rsbo") + # Filter ignore differences + diff_list = list(filter(lambda x: x not in ignore_list, diff_list)) + return diff_list + + def __sizeof__(self): + """Return the size in memory of the object (including all subobject)""" + + S = 0 # Full size of the object + + # Get size of the properties inherited from Subdomain + S += super(Subdomain_Airgap, self).__sizeof__() + S += getsizeof(self.A) + S += getsizeof(self.B) + S += getsizeof(self.C) + S += getsizeof(self.D) + S += getsizeof(self.Rrbo) + S += getsizeof(self.Rsbo) + return S + + def as_dict(self, type_handle_ndarray=0, keep_function=False, **kwargs): + """ + Convert this object in a json serializable dict (can be use in __init__). + type_handle_ndarray: int + How to handle ndarray (0: tolist, 1: copy, 2: nothing) + keep_function : bool + True to keep the function object, else return str + Optional keyword input parameter is for internal use only + and may prevent json serializability. + """ + + # Get the properties inherited from Subdomain + Subdomain_Airgap_dict = super(Subdomain_Airgap, self).as_dict( + type_handle_ndarray=type_handle_ndarray, + keep_function=keep_function, + **kwargs + ) + if self.A is None: + Subdomain_Airgap_dict["A"] = None + else: + if type_handle_ndarray == 0: + Subdomain_Airgap_dict["A"] = self.A.tolist() + elif type_handle_ndarray == 1: + Subdomain_Airgap_dict["A"] = self.A.copy() + elif type_handle_ndarray == 2: + Subdomain_Airgap_dict["A"] = self.A + else: + raise Exception( + "Unknown type_handle_ndarray: " + str(type_handle_ndarray) + ) + if self.B is None: + Subdomain_Airgap_dict["B"] = None + else: + if type_handle_ndarray == 0: + Subdomain_Airgap_dict["B"] = self.B.tolist() + elif type_handle_ndarray == 1: + Subdomain_Airgap_dict["B"] = self.B.copy() + elif type_handle_ndarray == 2: + Subdomain_Airgap_dict["B"] = self.B + else: + raise Exception( + "Unknown type_handle_ndarray: " + str(type_handle_ndarray) + ) + if self.C is None: + Subdomain_Airgap_dict["C"] = None + else: + if type_handle_ndarray == 0: + Subdomain_Airgap_dict["C"] = self.C.tolist() + elif type_handle_ndarray == 1: + Subdomain_Airgap_dict["C"] = self.C.copy() + elif type_handle_ndarray == 2: + Subdomain_Airgap_dict["C"] = self.C + else: + raise Exception( + "Unknown type_handle_ndarray: " + str(type_handle_ndarray) + ) + if self.D is None: + Subdomain_Airgap_dict["D"] = None + else: + if type_handle_ndarray == 0: + Subdomain_Airgap_dict["D"] = self.D.tolist() + elif type_handle_ndarray == 1: + Subdomain_Airgap_dict["D"] = self.D.copy() + elif type_handle_ndarray == 2: + Subdomain_Airgap_dict["D"] = self.D + else: + raise Exception( + "Unknown type_handle_ndarray: " + str(type_handle_ndarray) + ) + Subdomain_Airgap_dict["Rrbo"] = self.Rrbo + Subdomain_Airgap_dict["Rsbo"] = self.Rsbo + # The class name is added to the dict for deserialisation purpose + # Overwrite the mother class name + Subdomain_Airgap_dict["__class__"] = "Subdomain_Airgap" + return Subdomain_Airgap_dict + + def copy(self): + """Creates a deepcopy of the object""" + + # Handle deepcopy of all the properties + if self.A is None: + A_val = None + else: + A_val = self.A.copy() + if self.B is None: + B_val = None + else: + B_val = self.B.copy() + if self.C is None: + C_val = None + else: + C_val = self.C.copy() + if self.D is None: + D_val = None + else: + D_val = self.D.copy() + Rrbo_val = self.Rrbo + Rsbo_val = self.Rsbo + if self.k is None: + k_val = None + else: + k_val = self.k.copy() + number_val = self.number + permeability_relative_val = self.permeability_relative + # Creates new object of the same type with the copied properties + obj_copy = type(self)( + A=A_val, + B=B_val, + C=C_val, + D=D_val, + Rrbo=Rrbo_val, + Rsbo=Rsbo_val, + k=k_val, + number=number_val, + permeability_relative=permeability_relative_val, + ) + return obj_copy + + def _set_None(self): + """Set all the properties to None (except pyleecan object)""" + + self.A = None + self.B = None + self.C = None + self.D = None + self.Rrbo = None + self.Rsbo = None + # Set to None the properties inherited from Subdomain + super(Subdomain_Airgap, self)._set_None() + + def _get_A(self): + """getter of A""" + return self._A + + def _set_A(self, value): + """setter of A""" + if type(value) is int and value == -1: + value = array([]) + elif type(value) is list: + try: + value = array(value) + except: + pass + check_var("A", value, "ndarray") + self._A = value + + A = property( + fget=_get_A, + fset=_set_A, + doc=u"""First integration constant function of harmonic number and time + + :Type: ndarray + """, + ) + + def _get_B(self): + """getter of B""" + return self._B + + def _set_B(self, value): + """setter of B""" + if type(value) is int and value == -1: + value = array([]) + elif type(value) is list: + try: + value = array(value) + except: + pass + check_var("B", value, "ndarray") + self._B = value + + B = property( + fget=_get_B, + fset=_set_B, + doc=u"""Second integration constant function of harmonic number and time + + :Type: ndarray + """, + ) + + def _get_C(self): + """getter of C""" + return self._C + + def _set_C(self, value): + """setter of C""" + if type(value) is int and value == -1: + value = array([]) + elif type(value) is list: + try: + value = array(value) + except: + pass + check_var("C", value, "ndarray") + self._C = value + + C = property( + fget=_get_C, + fset=_set_C, + doc=u"""Third integration constant function of harmonic number and time + + :Type: ndarray + """, + ) + + def _get_D(self): + """getter of D""" + return self._D + + def _set_D(self, value): + """setter of D""" + if type(value) is int and value == -1: + value = array([]) + elif type(value) is list: + try: + value = array(value) + except: + pass + check_var("D", value, "ndarray") + self._D = value + + D = property( + fget=_get_D, + fset=_set_D, + doc=u"""Fourth integration constant function of harmonic number and time + + :Type: ndarray + """, + ) + + def _get_Rrbo(self): + """getter of Rrbo""" + return self._Rrbo + + def _set_Rrbo(self, value): + """setter of Rrbo""" + check_var("Rrbo", value, "float") + self._Rrbo = value + + Rrbo = property( + fget=_get_Rrbo, + fset=_set_Rrbo, + doc=u"""Rotor bore radius + + :Type: float + """, + ) + + def _get_Rsbo(self): + """getter of Rsbo""" + return self._Rsbo + + def _set_Rsbo(self, value): + """setter of Rsbo""" + check_var("Rsbo", value, "float") + self._Rsbo = value + + Rsbo = property( + fget=_get_Rsbo, + fset=_set_Rsbo, + doc=u"""Stator bore radius + + :Type: float + """, + ) diff --git a/pyleecan/Classes/Subdomain_MagnetSurface.py b/pyleecan/Classes/Subdomain_MagnetSurface.py new file mode 100644 index 000000000..2b6987df0 --- /dev/null +++ b/pyleecan/Classes/Subdomain_MagnetSurface.py @@ -0,0 +1,810 @@ +# -*- coding: utf-8 -*- +# File generated according to Generator/ClassesRef/Simulation/Subdomain_MagnetSurface.csv +# WARNING! All changes made in this file will be lost! +"""Method code available at https://github.com/Eomys/pyleecan/tree/master/pyleecan/Methods/Simulation/Subdomain_MagnetSurface +""" + +from os import linesep +from sys import getsizeof +from logging import getLogger +from ._check import set_array, check_var, raise_ +from ..Functions.get_logger import get_logger +from ..Functions.save import save +from ..Functions.load import load_init_dict +from ..Functions.Load.import_class import import_class +from copy import deepcopy +from .Subdomain import Subdomain + +# Import all class method +# Try/catch to remove unnecessary dependencies in unused method +try: + from ..Methods.Simulation.Subdomain_MagnetSurface.add_constants_numbers import ( + add_constants_numbers, + ) +except ImportError as error: + add_constants_numbers = error + +try: + from ..Methods.Simulation.Subdomain_MagnetSurface.comp_flux_density import ( + comp_flux_density, + ) +except ImportError as error: + comp_flux_density = error + +try: + from ..Methods.Simulation.Subdomain_MagnetSurface.comp_interface_airgap import ( + comp_interface_airgap, + ) +except ImportError as error: + comp_interface_airgap = error + +try: + from ..Methods.Simulation.Subdomain_MagnetSurface.comp_magnet_solution import ( + comp_magnet_solution, + ) +except ImportError as error: + comp_magnet_solution = error + +try: + from ..Methods.Simulation.Subdomain_MagnetSurface.comp_magnet_source import ( + comp_magnet_source, + ) +except ImportError as error: + comp_magnet_source = error + + +from numpy import array, array_equal +from numpy import isnan +from ._check import InitUnKnowClassError + + +class Subdomain_MagnetSurface(Subdomain): + """Subdomain class for surface permanent magnet region""" + + VERSION = 1 + + # Check ImportError to remove unnecessary dependencies in unused method + # cf Methods.Simulation.Subdomain_MagnetSurface.add_constants_numbers + if isinstance(add_constants_numbers, ImportError): + add_constants_numbers = property( + fget=lambda x: raise_( + ImportError( + "Can't use Subdomain_MagnetSurface method add_constants_numbers: " + + str(add_constants_numbers) + ) + ) + ) + else: + add_constants_numbers = add_constants_numbers + # cf Methods.Simulation.Subdomain_MagnetSurface.comp_flux_density + if isinstance(comp_flux_density, ImportError): + comp_flux_density = property( + fget=lambda x: raise_( + ImportError( + "Can't use Subdomain_MagnetSurface method comp_flux_density: " + + str(comp_flux_density) + ) + ) + ) + else: + comp_flux_density = comp_flux_density + # cf Methods.Simulation.Subdomain_MagnetSurface.comp_interface_airgap + if isinstance(comp_interface_airgap, ImportError): + comp_interface_airgap = property( + fget=lambda x: raise_( + ImportError( + "Can't use Subdomain_MagnetSurface method comp_interface_airgap: " + + str(comp_interface_airgap) + ) + ) + ) + else: + comp_interface_airgap = comp_interface_airgap + # cf Methods.Simulation.Subdomain_MagnetSurface.comp_magnet_solution + if isinstance(comp_magnet_solution, ImportError): + comp_magnet_solution = property( + fget=lambda x: raise_( + ImportError( + "Can't use Subdomain_MagnetSurface method comp_magnet_solution: " + + str(comp_magnet_solution) + ) + ) + ) + else: + comp_magnet_solution = comp_magnet_solution + # cf Methods.Simulation.Subdomain_MagnetSurface.comp_magnet_source + if isinstance(comp_magnet_source, ImportError): + comp_magnet_source = property( + fget=lambda x: raise_( + ImportError( + "Can't use Subdomain_MagnetSurface method comp_magnet_source: " + + str(comp_magnet_source) + ) + ) + ) + else: + comp_magnet_source = comp_magnet_source + # generic save method is available in all object + save = save + # get_logger method is available in all object + get_logger = get_logger + + def __init__( + self, + type_magnetization=0, + magnet_width=None, + Ryoke=None, + A=None, + B=None, + C=None, + D=None, + Rbore=None, + Mrn=None, + Mtn=None, + k=None, + number=None, + permeability_relative=1, + init_dict=None, + init_str=None, + ): + """Constructor of the class. Can be use in three ways : + - __init__ (arg1 = 1, arg3 = 5) every parameters have name and default values + for pyleecan type, -1 will call the default constructor + - __init__ (init_dict = d) d must be a dictionary with property names as keys + - __init__ (init_str = s) s must be a string + s is the file path to load + + ndarray or list can be given for Vector and Matrix + object or dict can be given for pyleecan Object""" + + if init_str is not None: # Load from a file + init_dict = load_init_dict(init_str)[1] + if init_dict is not None: # Initialisation by dict + assert type(init_dict) is dict + # Overwrite default value with init_dict content + if "type_magnetization" in list(init_dict.keys()): + type_magnetization = init_dict["type_magnetization"] + if "magnet_width" in list(init_dict.keys()): + magnet_width = init_dict["magnet_width"] + if "Ryoke" in list(init_dict.keys()): + Ryoke = init_dict["Ryoke"] + if "A" in list(init_dict.keys()): + A = init_dict["A"] + if "B" in list(init_dict.keys()): + B = init_dict["B"] + if "C" in list(init_dict.keys()): + C = init_dict["C"] + if "D" in list(init_dict.keys()): + D = init_dict["D"] + if "Rbore" in list(init_dict.keys()): + Rbore = init_dict["Rbore"] + if "Mrn" in list(init_dict.keys()): + Mrn = init_dict["Mrn"] + if "Mtn" in list(init_dict.keys()): + Mtn = init_dict["Mtn"] + if "k" in list(init_dict.keys()): + k = init_dict["k"] + if "number" in list(init_dict.keys()): + number = init_dict["number"] + if "permeability_relative" in list(init_dict.keys()): + permeability_relative = init_dict["permeability_relative"] + # Set the properties (value check and convertion are done in setter) + self.type_magnetization = type_magnetization + self.magnet_width = magnet_width + self.Ryoke = Ryoke + self.A = A + self.B = B + self.C = C + self.D = D + self.Rbore = Rbore + self.Mrn = Mrn + self.Mtn = Mtn + # Call Subdomain init + super(Subdomain_MagnetSurface, self).__init__( + k=k, number=number, permeability_relative=permeability_relative + ) + # The class is frozen (in Subdomain init), for now it's impossible to + # add new properties + + def __str__(self): + """Convert this object in a readeable string (for print)""" + + Subdomain_MagnetSurface_str = "" + # Get the properties inherited from Subdomain + Subdomain_MagnetSurface_str += super(Subdomain_MagnetSurface, self).__str__() + Subdomain_MagnetSurface_str += ( + "type_magnetization = " + str(self.type_magnetization) + linesep + ) + Subdomain_MagnetSurface_str += ( + "magnet_width = " + str(self.magnet_width) + linesep + ) + Subdomain_MagnetSurface_str += "Ryoke = " + str(self.Ryoke) + linesep + Subdomain_MagnetSurface_str += ( + "A = " + + linesep + + str(self.A).replace(linesep, linesep + "\t") + + linesep + + linesep + ) + Subdomain_MagnetSurface_str += ( + "B = " + + linesep + + str(self.B).replace(linesep, linesep + "\t") + + linesep + + linesep + ) + Subdomain_MagnetSurface_str += ( + "C = " + + linesep + + str(self.C).replace(linesep, linesep + "\t") + + linesep + + linesep + ) + Subdomain_MagnetSurface_str += ( + "D = " + + linesep + + str(self.D).replace(linesep, linesep + "\t") + + linesep + + linesep + ) + Subdomain_MagnetSurface_str += "Rbore = " + str(self.Rbore) + linesep + Subdomain_MagnetSurface_str += ( + "Mrn = " + + linesep + + str(self.Mrn).replace(linesep, linesep + "\t") + + linesep + + linesep + ) + Subdomain_MagnetSurface_str += ( + "Mtn = " + + linesep + + str(self.Mtn).replace(linesep, linesep + "\t") + + linesep + + linesep + ) + return Subdomain_MagnetSurface_str + + def __eq__(self, other): + """Compare two objects (skip parent)""" + + if type(other) != type(self): + return False + + # Check the properties inherited from Subdomain + if not super(Subdomain_MagnetSurface, self).__eq__(other): + return False + if other.type_magnetization != self.type_magnetization: + return False + if other.magnet_width != self.magnet_width: + return False + if other.Ryoke != self.Ryoke: + return False + if not array_equal(other.A, self.A): + return False + if not array_equal(other.B, self.B): + return False + if not array_equal(other.C, self.C): + return False + if not array_equal(other.D, self.D): + return False + if other.Rbore != self.Rbore: + return False + if not array_equal(other.Mrn, self.Mrn): + return False + if not array_equal(other.Mtn, self.Mtn): + return False + return True + + def compare(self, other, name="self", ignore_list=None, is_add_value=False): + """Compare two objects and return list of differences""" + + if ignore_list is None: + ignore_list = list() + if type(other) != type(self): + return ["type(" + name + ")"] + diff_list = list() + + # Check the properties inherited from Subdomain + diff_list.extend( + super(Subdomain_MagnetSurface, self).compare( + other, name=name, ignore_list=ignore_list, is_add_value=is_add_value + ) + ) + if other._type_magnetization != self._type_magnetization: + if is_add_value: + val_str = ( + " (self=" + + str(self._type_magnetization) + + ", other=" + + str(other._type_magnetization) + + ")" + ) + diff_list.append(name + ".type_magnetization" + val_str) + else: + diff_list.append(name + ".type_magnetization") + if ( + other._magnet_width is not None + and self._magnet_width is not None + and isnan(other._magnet_width) + and isnan(self._magnet_width) + ): + pass + elif other._magnet_width != self._magnet_width: + if is_add_value: + val_str = ( + " (self=" + + str(self._magnet_width) + + ", other=" + + str(other._magnet_width) + + ")" + ) + diff_list.append(name + ".magnet_width" + val_str) + else: + diff_list.append(name + ".magnet_width") + if ( + other._Ryoke is not None + and self._Ryoke is not None + and isnan(other._Ryoke) + and isnan(self._Ryoke) + ): + pass + elif other._Ryoke != self._Ryoke: + if is_add_value: + val_str = ( + " (self=" + str(self._Ryoke) + ", other=" + str(other._Ryoke) + ")" + ) + diff_list.append(name + ".Ryoke" + val_str) + else: + diff_list.append(name + ".Ryoke") + if not array_equal(other.A, self.A): + diff_list.append(name + ".A") + if not array_equal(other.B, self.B): + diff_list.append(name + ".B") + if not array_equal(other.C, self.C): + diff_list.append(name + ".C") + if not array_equal(other.D, self.D): + diff_list.append(name + ".D") + if ( + other._Rbore is not None + and self._Rbore is not None + and isnan(other._Rbore) + and isnan(self._Rbore) + ): + pass + elif other._Rbore != self._Rbore: + if is_add_value: + val_str = ( + " (self=" + str(self._Rbore) + ", other=" + str(other._Rbore) + ")" + ) + diff_list.append(name + ".Rbore" + val_str) + else: + diff_list.append(name + ".Rbore") + if not array_equal(other.Mrn, self.Mrn): + diff_list.append(name + ".Mrn") + if not array_equal(other.Mtn, self.Mtn): + diff_list.append(name + ".Mtn") + # Filter ignore differences + diff_list = list(filter(lambda x: x not in ignore_list, diff_list)) + return diff_list + + def __sizeof__(self): + """Return the size in memory of the object (including all subobject)""" + + S = 0 # Full size of the object + + # Get size of the properties inherited from Subdomain + S += super(Subdomain_MagnetSurface, self).__sizeof__() + S += getsizeof(self.type_magnetization) + S += getsizeof(self.magnet_width) + S += getsizeof(self.Ryoke) + S += getsizeof(self.A) + S += getsizeof(self.B) + S += getsizeof(self.C) + S += getsizeof(self.D) + S += getsizeof(self.Rbore) + S += getsizeof(self.Mrn) + S += getsizeof(self.Mtn) + return S + + def as_dict(self, type_handle_ndarray=0, keep_function=False, **kwargs): + """ + Convert this object in a json serializable dict (can be use in __init__). + type_handle_ndarray: int + How to handle ndarray (0: tolist, 1: copy, 2: nothing) + keep_function : bool + True to keep the function object, else return str + Optional keyword input parameter is for internal use only + and may prevent json serializability. + """ + + # Get the properties inherited from Subdomain + Subdomain_MagnetSurface_dict = super(Subdomain_MagnetSurface, self).as_dict( + type_handle_ndarray=type_handle_ndarray, + keep_function=keep_function, + **kwargs + ) + Subdomain_MagnetSurface_dict["type_magnetization"] = self.type_magnetization + Subdomain_MagnetSurface_dict["magnet_width"] = self.magnet_width + Subdomain_MagnetSurface_dict["Ryoke"] = self.Ryoke + if self.A is None: + Subdomain_MagnetSurface_dict["A"] = None + else: + if type_handle_ndarray == 0: + Subdomain_MagnetSurface_dict["A"] = self.A.tolist() + elif type_handle_ndarray == 1: + Subdomain_MagnetSurface_dict["A"] = self.A.copy() + elif type_handle_ndarray == 2: + Subdomain_MagnetSurface_dict["A"] = self.A + else: + raise Exception( + "Unknown type_handle_ndarray: " + str(type_handle_ndarray) + ) + if self.B is None: + Subdomain_MagnetSurface_dict["B"] = None + else: + if type_handle_ndarray == 0: + Subdomain_MagnetSurface_dict["B"] = self.B.tolist() + elif type_handle_ndarray == 1: + Subdomain_MagnetSurface_dict["B"] = self.B.copy() + elif type_handle_ndarray == 2: + Subdomain_MagnetSurface_dict["B"] = self.B + else: + raise Exception( + "Unknown type_handle_ndarray: " + str(type_handle_ndarray) + ) + if self.C is None: + Subdomain_MagnetSurface_dict["C"] = None + else: + if type_handle_ndarray == 0: + Subdomain_MagnetSurface_dict["C"] = self.C.tolist() + elif type_handle_ndarray == 1: + Subdomain_MagnetSurface_dict["C"] = self.C.copy() + elif type_handle_ndarray == 2: + Subdomain_MagnetSurface_dict["C"] = self.C + else: + raise Exception( + "Unknown type_handle_ndarray: " + str(type_handle_ndarray) + ) + if self.D is None: + Subdomain_MagnetSurface_dict["D"] = None + else: + if type_handle_ndarray == 0: + Subdomain_MagnetSurface_dict["D"] = self.D.tolist() + elif type_handle_ndarray == 1: + Subdomain_MagnetSurface_dict["D"] = self.D.copy() + elif type_handle_ndarray == 2: + Subdomain_MagnetSurface_dict["D"] = self.D + else: + raise Exception( + "Unknown type_handle_ndarray: " + str(type_handle_ndarray) + ) + Subdomain_MagnetSurface_dict["Rbore"] = self.Rbore + if self.Mrn is None: + Subdomain_MagnetSurface_dict["Mrn"] = None + else: + if type_handle_ndarray == 0: + Subdomain_MagnetSurface_dict["Mrn"] = self.Mrn.tolist() + elif type_handle_ndarray == 1: + Subdomain_MagnetSurface_dict["Mrn"] = self.Mrn.copy() + elif type_handle_ndarray == 2: + Subdomain_MagnetSurface_dict["Mrn"] = self.Mrn + else: + raise Exception( + "Unknown type_handle_ndarray: " + str(type_handle_ndarray) + ) + if self.Mtn is None: + Subdomain_MagnetSurface_dict["Mtn"] = None + else: + if type_handle_ndarray == 0: + Subdomain_MagnetSurface_dict["Mtn"] = self.Mtn.tolist() + elif type_handle_ndarray == 1: + Subdomain_MagnetSurface_dict["Mtn"] = self.Mtn.copy() + elif type_handle_ndarray == 2: + Subdomain_MagnetSurface_dict["Mtn"] = self.Mtn + else: + raise Exception( + "Unknown type_handle_ndarray: " + str(type_handle_ndarray) + ) + # The class name is added to the dict for deserialisation purpose + # Overwrite the mother class name + Subdomain_MagnetSurface_dict["__class__"] = "Subdomain_MagnetSurface" + return Subdomain_MagnetSurface_dict + + def copy(self): + """Creates a deepcopy of the object""" + + # Handle deepcopy of all the properties + type_magnetization_val = self.type_magnetization + magnet_width_val = self.magnet_width + Ryoke_val = self.Ryoke + if self.A is None: + A_val = None + else: + A_val = self.A.copy() + if self.B is None: + B_val = None + else: + B_val = self.B.copy() + if self.C is None: + C_val = None + else: + C_val = self.C.copy() + if self.D is None: + D_val = None + else: + D_val = self.D.copy() + Rbore_val = self.Rbore + if self.Mrn is None: + Mrn_val = None + else: + Mrn_val = self.Mrn.copy() + if self.Mtn is None: + Mtn_val = None + else: + Mtn_val = self.Mtn.copy() + if self.k is None: + k_val = None + else: + k_val = self.k.copy() + number_val = self.number + permeability_relative_val = self.permeability_relative + # Creates new object of the same type with the copied properties + obj_copy = type(self)( + type_magnetization=type_magnetization_val, + magnet_width=magnet_width_val, + Ryoke=Ryoke_val, + A=A_val, + B=B_val, + C=C_val, + D=D_val, + Rbore=Rbore_val, + Mrn=Mrn_val, + Mtn=Mtn_val, + k=k_val, + number=number_val, + permeability_relative=permeability_relative_val, + ) + return obj_copy + + def _set_None(self): + """Set all the properties to None (except pyleecan object)""" + + self.type_magnetization = None + self.magnet_width = None + self.Ryoke = None + self.A = None + self.B = None + self.C = None + self.D = None + self.Rbore = None + self.Mrn = None + self.Mtn = None + # Set to None the properties inherited from Subdomain + super(Subdomain_MagnetSurface, self)._set_None() + + def _get_type_magnetization(self): + """getter of type_magnetization""" + return self._type_magnetization + + def _set_type_magnetization(self, value): + """setter of type_magnetization""" + check_var("type_magnetization", value, "int", Vmin=0, Vmax=3) + self._type_magnetization = value + + type_magnetization = property( + fget=_get_type_magnetization, + fset=_set_type_magnetization, + doc=u"""Magnetization type given by machine properties + + :Type: int + :min: 0 + :max: 3 + """, + ) + + def _get_magnet_width(self): + """getter of magnet_width""" + return self._magnet_width + + def _set_magnet_width(self, value): + """setter of magnet_width""" + check_var("magnet_width", value, "float", Vmin=0) + self._magnet_width = value + + magnet_width = property( + fget=_get_magnet_width, + fset=_set_magnet_width, + doc=u"""Angular width of a magnet + + :Type: float + :min: 0 + """, + ) + + def _get_Ryoke(self): + """getter of Ryoke""" + return self._Ryoke + + def _set_Ryoke(self, value): + """setter of Ryoke""" + check_var("Ryoke", value, "float", Vmin=0) + self._Ryoke = value + + Ryoke = property( + fget=_get_Ryoke, + fset=_set_Ryoke, + doc=u"""Radius at magnet / yoke interface + + :Type: float + :min: 0 + """, + ) + + def _get_A(self): + """getter of A""" + return self._A + + def _set_A(self, value): + """setter of A""" + if type(value) is int and value == -1: + value = array([]) + elif type(value) is list: + try: + value = array(value) + except: + pass + check_var("A", value, "ndarray") + self._A = value + + A = property( + fget=_get_A, + fset=_set_A, + doc=u"""First integration constant function of harmonic number and time + + :Type: ndarray + """, + ) + + def _get_B(self): + """getter of B""" + return self._B + + def _set_B(self, value): + """setter of B""" + if type(value) is int and value == -1: + value = array([]) + elif type(value) is list: + try: + value = array(value) + except: + pass + check_var("B", value, "ndarray") + self._B = value + + B = property( + fget=_get_B, + fset=_set_B, + doc=u"""Second integration constant function of harmonic number and time + + :Type: ndarray + """, + ) + + def _get_C(self): + """getter of C""" + return self._C + + def _set_C(self, value): + """setter of C""" + if type(value) is int and value == -1: + value = array([]) + elif type(value) is list: + try: + value = array(value) + except: + pass + check_var("C", value, "ndarray") + self._C = value + + C = property( + fget=_get_C, + fset=_set_C, + doc=u"""Third integration constant function of harmonic number and time + + :Type: ndarray + """, + ) + + def _get_D(self): + """getter of D""" + return self._D + + def _set_D(self, value): + """setter of D""" + if type(value) is int and value == -1: + value = array([]) + elif type(value) is list: + try: + value = array(value) + except: + pass + check_var("D", value, "ndarray") + self._D = value + + D = property( + fget=_get_D, + fset=_set_D, + doc=u"""Fourth integration constant function of harmonic number and time + + :Type: ndarray + """, + ) + + def _get_Rbore(self): + """getter of Rbore""" + return self._Rbore + + def _set_Rbore(self, value): + """setter of Rbore""" + check_var("Rbore", value, "float", Vmin=0) + self._Rbore = value + + Rbore = property( + fget=_get_Rbore, + fset=_set_Rbore, + doc=u"""Radius at magnet / airgap interface + + :Type: float + :min: 0 + """, + ) + + def _get_Mrn(self): + """getter of Mrn""" + return self._Mrn + + def _set_Mrn(self, value): + """setter of Mrn""" + if type(value) is int and value == -1: + value = array([]) + elif type(value) is list: + try: + value = array(value) + except: + pass + check_var("Mrn", value, "ndarray") + self._Mrn = value + + Mrn = property( + fget=_get_Mrn, + fset=_set_Mrn, + doc=u"""Fourier series of radial magnetization + + :Type: ndarray + """, + ) + + def _get_Mtn(self): + """getter of Mtn""" + return self._Mtn + + def _set_Mtn(self, value): + """setter of Mtn""" + if type(value) is int and value == -1: + value = array([]) + elif type(value) is list: + try: + value = array(value) + except: + pass + check_var("Mtn", value, "ndarray") + self._Mtn = value + + Mtn = property( + fget=_get_Mtn, + fset=_set_Mtn, + doc=u"""Fourier series of circumferential magnetization + + :Type: ndarray + """, + ) diff --git a/pyleecan/Classes/Subdomain_Slot.py b/pyleecan/Classes/Subdomain_Slot.py new file mode 100644 index 000000000..0411dc212 --- /dev/null +++ b/pyleecan/Classes/Subdomain_Slot.py @@ -0,0 +1,760 @@ +# -*- coding: utf-8 -*- +# File generated according to Generator/ClassesRef/Simulation/Subdomain_Slot.csv +# WARNING! All changes made in this file will be lost! +"""Method code available at https://github.com/Eomys/pyleecan/tree/master/pyleecan/Methods/Simulation/Subdomain_Slot +""" + +from os import linesep +from sys import getsizeof +from logging import getLogger +from ._check import set_array, check_var, raise_ +from ..Functions.get_logger import get_logger +from ..Functions.save import save +from ..Functions.load import load_init_dict +from ..Functions.Load.import_class import import_class +from copy import deepcopy +from .Subdomain import Subdomain + +# Import all class method +# Try/catch to remove unnecessary dependencies in unused method +try: + from ..Methods.Simulation.Subdomain_Slot.add_constants_numbers import ( + add_constants_numbers, + ) +except ImportError as error: + add_constants_numbers = error + +try: + from ..Methods.Simulation.Subdomain_Slot.comp_current_solution import ( + comp_current_solution, + ) +except ImportError as error: + comp_current_solution = error + +try: + from ..Methods.Simulation.Subdomain_Slot.comp_current_source import ( + comp_current_source, + ) +except ImportError as error: + comp_current_source = error + +try: + from ..Methods.Simulation.Subdomain_Slot.comp_flux_density import comp_flux_density +except ImportError as error: + comp_flux_density = error + +try: + from ..Methods.Simulation.Subdomain_Slot.comp_interface_airgap import ( + comp_interface_airgap, + ) +except ImportError as error: + comp_interface_airgap = error + +try: + from ..Methods.Simulation.Subdomain_Slot.comp_Phi_wind import comp_Phi_wind +except ImportError as error: + comp_Phi_wind = error + + +from numpy import array, array_equal +from numpy import isnan +from ._check import InitUnKnowClassError + + +class Subdomain_Slot(Subdomain): + """Subdomain class for slots regions without openings and with windings""" + + VERSION = 1 + + # Check ImportError to remove unnecessary dependencies in unused method + # cf Methods.Simulation.Subdomain_Slot.add_constants_numbers + if isinstance(add_constants_numbers, ImportError): + add_constants_numbers = property( + fget=lambda x: raise_( + ImportError( + "Can't use Subdomain_Slot method add_constants_numbers: " + + str(add_constants_numbers) + ) + ) + ) + else: + add_constants_numbers = add_constants_numbers + # cf Methods.Simulation.Subdomain_Slot.comp_current_solution + if isinstance(comp_current_solution, ImportError): + comp_current_solution = property( + fget=lambda x: raise_( + ImportError( + "Can't use Subdomain_Slot method comp_current_solution: " + + str(comp_current_solution) + ) + ) + ) + else: + comp_current_solution = comp_current_solution + # cf Methods.Simulation.Subdomain_Slot.comp_current_source + if isinstance(comp_current_source, ImportError): + comp_current_source = property( + fget=lambda x: raise_( + ImportError( + "Can't use Subdomain_Slot method comp_current_source: " + + str(comp_current_source) + ) + ) + ) + else: + comp_current_source = comp_current_source + # cf Methods.Simulation.Subdomain_Slot.comp_flux_density + if isinstance(comp_flux_density, ImportError): + comp_flux_density = property( + fget=lambda x: raise_( + ImportError( + "Can't use Subdomain_Slot method comp_flux_density: " + + str(comp_flux_density) + ) + ) + ) + else: + comp_flux_density = comp_flux_density + # cf Methods.Simulation.Subdomain_Slot.comp_interface_airgap + if isinstance(comp_interface_airgap, ImportError): + comp_interface_airgap = property( + fget=lambda x: raise_( + ImportError( + "Can't use Subdomain_Slot method comp_interface_airgap: " + + str(comp_interface_airgap) + ) + ) + ) + else: + comp_interface_airgap = comp_interface_airgap + # cf Methods.Simulation.Subdomain_Slot.comp_Phi_wind + if isinstance(comp_Phi_wind, ImportError): + comp_Phi_wind = property( + fget=lambda x: raise_( + ImportError( + "Can't use Subdomain_Slot method comp_Phi_wind: " + + str(comp_Phi_wind) + ) + ) + ) + else: + comp_Phi_wind = comp_Phi_wind + # generic save method is available in all object + save = save + # get_logger method is available in all object + get_logger = get_logger + + def __init__( + self, + A=None, + B=None, + center_angle=None, + slot_width=None, + Ji=None, + Jik=None, + Ryoke=None, + Rbore=None, + number_per_a=None, + k=None, + number=None, + permeability_relative=1, + init_dict=None, + init_str=None, + ): + """Constructor of the class. Can be use in three ways : + - __init__ (arg1 = 1, arg3 = 5) every parameters have name and default values + for pyleecan type, -1 will call the default constructor + - __init__ (init_dict = d) d must be a dictionary with property names as keys + - __init__ (init_str = s) s must be a string + s is the file path to load + + ndarray or list can be given for Vector and Matrix + object or dict can be given for pyleecan Object""" + + if init_str is not None: # Load from a file + init_dict = load_init_dict(init_str)[1] + if init_dict is not None: # Initialisation by dict + assert type(init_dict) is dict + # Overwrite default value with init_dict content + if "A" in list(init_dict.keys()): + A = init_dict["A"] + if "B" in list(init_dict.keys()): + B = init_dict["B"] + if "center_angle" in list(init_dict.keys()): + center_angle = init_dict["center_angle"] + if "slot_width" in list(init_dict.keys()): + slot_width = init_dict["slot_width"] + if "Ji" in list(init_dict.keys()): + Ji = init_dict["Ji"] + if "Jik" in list(init_dict.keys()): + Jik = init_dict["Jik"] + if "Ryoke" in list(init_dict.keys()): + Ryoke = init_dict["Ryoke"] + if "Rbore" in list(init_dict.keys()): + Rbore = init_dict["Rbore"] + if "number_per_a" in list(init_dict.keys()): + number_per_a = init_dict["number_per_a"] + if "k" in list(init_dict.keys()): + k = init_dict["k"] + if "number" in list(init_dict.keys()): + number = init_dict["number"] + if "permeability_relative" in list(init_dict.keys()): + permeability_relative = init_dict["permeability_relative"] + # Set the properties (value check and convertion are done in setter) + self.A = A + self.B = B + self.center_angle = center_angle + self.slot_width = slot_width + self.Ji = Ji + self.Jik = Jik + self.Ryoke = Ryoke + self.Rbore = Rbore + self.number_per_a = number_per_a + # Call Subdomain init + super(Subdomain_Slot, self).__init__( + k=k, number=number, permeability_relative=permeability_relative + ) + # The class is frozen (in Subdomain init), for now it's impossible to + # add new properties + + def __str__(self): + """Convert this object in a readeable string (for print)""" + + Subdomain_Slot_str = "" + # Get the properties inherited from Subdomain + Subdomain_Slot_str += super(Subdomain_Slot, self).__str__() + Subdomain_Slot_str += ( + "A = " + + linesep + + str(self.A).replace(linesep, linesep + "\t") + + linesep + + linesep + ) + Subdomain_Slot_str += ( + "B = " + + linesep + + str(self.B).replace(linesep, linesep + "\t") + + linesep + + linesep + ) + Subdomain_Slot_str += ( + "center_angle = " + + linesep + + str(self.center_angle).replace(linesep, linesep + "\t") + + linesep + + linesep + ) + Subdomain_Slot_str += "slot_width = " + str(self.slot_width) + linesep + Subdomain_Slot_str += ( + "Ji = " + + linesep + + str(self.Ji).replace(linesep, linesep + "\t") + + linesep + + linesep + ) + Subdomain_Slot_str += ( + "Jik = " + + linesep + + str(self.Jik).replace(linesep, linesep + "\t") + + linesep + + linesep + ) + Subdomain_Slot_str += "Ryoke = " + str(self.Ryoke) + linesep + Subdomain_Slot_str += "Rbore = " + str(self.Rbore) + linesep + Subdomain_Slot_str += "number_per_a = " + str(self.number_per_a) + linesep + return Subdomain_Slot_str + + def __eq__(self, other): + """Compare two objects (skip parent)""" + + if type(other) != type(self): + return False + + # Check the properties inherited from Subdomain + if not super(Subdomain_Slot, self).__eq__(other): + return False + if not array_equal(other.A, self.A): + return False + if not array_equal(other.B, self.B): + return False + if not array_equal(other.center_angle, self.center_angle): + return False + if other.slot_width != self.slot_width: + return False + if not array_equal(other.Ji, self.Ji): + return False + if not array_equal(other.Jik, self.Jik): + return False + if other.Ryoke != self.Ryoke: + return False + if other.Rbore != self.Rbore: + return False + if other.number_per_a != self.number_per_a: + return False + return True + + def compare(self, other, name="self", ignore_list=None, is_add_value=False): + """Compare two objects and return list of differences""" + + if ignore_list is None: + ignore_list = list() + if type(other) != type(self): + return ["type(" + name + ")"] + diff_list = list() + + # Check the properties inherited from Subdomain + diff_list.extend( + super(Subdomain_Slot, self).compare( + other, name=name, ignore_list=ignore_list, is_add_value=is_add_value + ) + ) + if not array_equal(other.A, self.A): + diff_list.append(name + ".A") + if not array_equal(other.B, self.B): + diff_list.append(name + ".B") + if not array_equal(other.center_angle, self.center_angle): + diff_list.append(name + ".center_angle") + if ( + other._slot_width is not None + and self._slot_width is not None + and isnan(other._slot_width) + and isnan(self._slot_width) + ): + pass + elif other._slot_width != self._slot_width: + if is_add_value: + val_str = ( + " (self=" + + str(self._slot_width) + + ", other=" + + str(other._slot_width) + + ")" + ) + diff_list.append(name + ".slot_width" + val_str) + else: + diff_list.append(name + ".slot_width") + if not array_equal(other.Ji, self.Ji): + diff_list.append(name + ".Ji") + if not array_equal(other.Jik, self.Jik): + diff_list.append(name + ".Jik") + if ( + other._Ryoke is not None + and self._Ryoke is not None + and isnan(other._Ryoke) + and isnan(self._Ryoke) + ): + pass + elif other._Ryoke != self._Ryoke: + if is_add_value: + val_str = ( + " (self=" + str(self._Ryoke) + ", other=" + str(other._Ryoke) + ")" + ) + diff_list.append(name + ".Ryoke" + val_str) + else: + diff_list.append(name + ".Ryoke") + if ( + other._Rbore is not None + and self._Rbore is not None + and isnan(other._Rbore) + and isnan(self._Rbore) + ): + pass + elif other._Rbore != self._Rbore: + if is_add_value: + val_str = ( + " (self=" + str(self._Rbore) + ", other=" + str(other._Rbore) + ")" + ) + diff_list.append(name + ".Rbore" + val_str) + else: + diff_list.append(name + ".Rbore") + if other._number_per_a != self._number_per_a: + if is_add_value: + val_str = ( + " (self=" + + str(self._number_per_a) + + ", other=" + + str(other._number_per_a) + + ")" + ) + diff_list.append(name + ".number_per_a" + val_str) + else: + diff_list.append(name + ".number_per_a") + # Filter ignore differences + diff_list = list(filter(lambda x: x not in ignore_list, diff_list)) + return diff_list + + def __sizeof__(self): + """Return the size in memory of the object (including all subobject)""" + + S = 0 # Full size of the object + + # Get size of the properties inherited from Subdomain + S += super(Subdomain_Slot, self).__sizeof__() + S += getsizeof(self.A) + S += getsizeof(self.B) + S += getsizeof(self.center_angle) + S += getsizeof(self.slot_width) + S += getsizeof(self.Ji) + S += getsizeof(self.Jik) + S += getsizeof(self.Ryoke) + S += getsizeof(self.Rbore) + S += getsizeof(self.number_per_a) + return S + + def as_dict(self, type_handle_ndarray=0, keep_function=False, **kwargs): + """ + Convert this object in a json serializable dict (can be use in __init__). + type_handle_ndarray: int + How to handle ndarray (0: tolist, 1: copy, 2: nothing) + keep_function : bool + True to keep the function object, else return str + Optional keyword input parameter is for internal use only + and may prevent json serializability. + """ + + # Get the properties inherited from Subdomain + Subdomain_Slot_dict = super(Subdomain_Slot, self).as_dict( + type_handle_ndarray=type_handle_ndarray, + keep_function=keep_function, + **kwargs + ) + if self.A is None: + Subdomain_Slot_dict["A"] = None + else: + if type_handle_ndarray == 0: + Subdomain_Slot_dict["A"] = self.A.tolist() + elif type_handle_ndarray == 1: + Subdomain_Slot_dict["A"] = self.A.copy() + elif type_handle_ndarray == 2: + Subdomain_Slot_dict["A"] = self.A + else: + raise Exception( + "Unknown type_handle_ndarray: " + str(type_handle_ndarray) + ) + if self.B is None: + Subdomain_Slot_dict["B"] = None + else: + if type_handle_ndarray == 0: + Subdomain_Slot_dict["B"] = self.B.tolist() + elif type_handle_ndarray == 1: + Subdomain_Slot_dict["B"] = self.B.copy() + elif type_handle_ndarray == 2: + Subdomain_Slot_dict["B"] = self.B + else: + raise Exception( + "Unknown type_handle_ndarray: " + str(type_handle_ndarray) + ) + if self.center_angle is None: + Subdomain_Slot_dict["center_angle"] = None + else: + if type_handle_ndarray == 0: + Subdomain_Slot_dict["center_angle"] = self.center_angle.tolist() + elif type_handle_ndarray == 1: + Subdomain_Slot_dict["center_angle"] = self.center_angle.copy() + elif type_handle_ndarray == 2: + Subdomain_Slot_dict["center_angle"] = self.center_angle + else: + raise Exception( + "Unknown type_handle_ndarray: " + str(type_handle_ndarray) + ) + Subdomain_Slot_dict["slot_width"] = self.slot_width + if self.Ji is None: + Subdomain_Slot_dict["Ji"] = None + else: + if type_handle_ndarray == 0: + Subdomain_Slot_dict["Ji"] = self.Ji.tolist() + elif type_handle_ndarray == 1: + Subdomain_Slot_dict["Ji"] = self.Ji.copy() + elif type_handle_ndarray == 2: + Subdomain_Slot_dict["Ji"] = self.Ji + else: + raise Exception( + "Unknown type_handle_ndarray: " + str(type_handle_ndarray) + ) + if self.Jik is None: + Subdomain_Slot_dict["Jik"] = None + else: + if type_handle_ndarray == 0: + Subdomain_Slot_dict["Jik"] = self.Jik.tolist() + elif type_handle_ndarray == 1: + Subdomain_Slot_dict["Jik"] = self.Jik.copy() + elif type_handle_ndarray == 2: + Subdomain_Slot_dict["Jik"] = self.Jik + else: + raise Exception( + "Unknown type_handle_ndarray: " + str(type_handle_ndarray) + ) + Subdomain_Slot_dict["Ryoke"] = self.Ryoke + Subdomain_Slot_dict["Rbore"] = self.Rbore + Subdomain_Slot_dict["number_per_a"] = self.number_per_a + # The class name is added to the dict for deserialisation purpose + # Overwrite the mother class name + Subdomain_Slot_dict["__class__"] = "Subdomain_Slot" + return Subdomain_Slot_dict + + def copy(self): + """Creates a deepcopy of the object""" + + # Handle deepcopy of all the properties + if self.A is None: + A_val = None + else: + A_val = self.A.copy() + if self.B is None: + B_val = None + else: + B_val = self.B.copy() + if self.center_angle is None: + center_angle_val = None + else: + center_angle_val = self.center_angle.copy() + slot_width_val = self.slot_width + if self.Ji is None: + Ji_val = None + else: + Ji_val = self.Ji.copy() + if self.Jik is None: + Jik_val = None + else: + Jik_val = self.Jik.copy() + Ryoke_val = self.Ryoke + Rbore_val = self.Rbore + number_per_a_val = self.number_per_a + if self.k is None: + k_val = None + else: + k_val = self.k.copy() + number_val = self.number + permeability_relative_val = self.permeability_relative + # Creates new object of the same type with the copied properties + obj_copy = type(self)( + A=A_val, + B=B_val, + center_angle=center_angle_val, + slot_width=slot_width_val, + Ji=Ji_val, + Jik=Jik_val, + Ryoke=Ryoke_val, + Rbore=Rbore_val, + number_per_a=number_per_a_val, + k=k_val, + number=number_val, + permeability_relative=permeability_relative_val, + ) + return obj_copy + + def _set_None(self): + """Set all the properties to None (except pyleecan object)""" + + self.A = None + self.B = None + self.center_angle = None + self.slot_width = None + self.Ji = None + self.Jik = None + self.Ryoke = None + self.Rbore = None + self.number_per_a = None + # Set to None the properties inherited from Subdomain + super(Subdomain_Slot, self)._set_None() + + def _get_A(self): + """getter of A""" + return self._A + + def _set_A(self, value): + """setter of A""" + if type(value) is int and value == -1: + value = array([]) + elif type(value) is list: + try: + value = array(value) + except: + pass + check_var("A", value, "ndarray") + self._A = value + + A = property( + fget=_get_A, + fset=_set_A, + doc=u"""First integration constant function of harmonic number and time + + :Type: ndarray + """, + ) + + def _get_B(self): + """getter of B""" + return self._B + + def _set_B(self, value): + """setter of B""" + if type(value) is int and value == -1: + value = array([]) + elif type(value) is list: + try: + value = array(value) + except: + pass + check_var("B", value, "ndarray") + self._B = value + + B = property( + fget=_get_B, + fset=_set_B, + doc=u"""Second integration constant function of harmonic number and time + + :Type: ndarray + """, + ) + + def _get_center_angle(self): + """getter of center_angle""" + return self._center_angle + + def _set_center_angle(self, value): + """setter of center_angle""" + if type(value) is int and value == -1: + value = array([]) + elif type(value) is list: + try: + value = array(value) + except: + pass + check_var("center_angle", value, "ndarray") + self._center_angle = value + + center_angle = property( + fget=_get_center_angle, + fset=_set_center_angle, + doc=u"""Angle value at slot center + + :Type: ndarray + """, + ) + + def _get_slot_width(self): + """getter of slot_width""" + return self._slot_width + + def _set_slot_width(self, value): + """setter of slot_width""" + check_var("slot_width", value, "float", Vmin=0) + self._slot_width = value + + slot_width = property( + fget=_get_slot_width, + fset=_set_slot_width, + doc=u"""Angular width of slot + + :Type: float + :min: 0 + """, + ) + + def _get_Ji(self): + """getter of Ji""" + return self._Ji + + def _set_Ji(self, value): + """setter of Ji""" + if type(value) is int and value == -1: + value = array([]) + elif type(value) is list: + try: + value = array(value) + except: + pass + check_var("Ji", value, "ndarray") + self._Ji = value + + Ji = property( + fget=_get_Ji, + fset=_set_Ji, + doc=u"""Average current density in slots + + :Type: ndarray + """, + ) + + def _get_Jik(self): + """getter of Jik""" + return self._Jik + + def _set_Jik(self, value): + """setter of Jik""" + if type(value) is int and value == -1: + value = array([]) + elif type(value) is list: + try: + value = array(value) + except: + pass + check_var("Jik", value, "ndarray") + self._Jik = value + + Jik = property( + fget=_get_Jik, + fset=_set_Jik, + doc=u"""Current density space harmonics in slots for concentrated double layer windings + + :Type: ndarray + """, + ) + + def _get_Ryoke(self): + """getter of Ryoke""" + return self._Ryoke + + def _set_Ryoke(self, value): + """setter of Ryoke""" + check_var("Ryoke", value, "float", Vmin=0) + self._Ryoke = value + + Ryoke = property( + fget=_get_Ryoke, + fset=_set_Ryoke, + doc=u"""Radius at slot / yoke interface + + :Type: float + :min: 0 + """, + ) + + def _get_Rbore(self): + """getter of Rbore""" + return self._Rbore + + def _set_Rbore(self, value): + """setter of Rbore""" + check_var("Rbore", value, "float", Vmin=0) + self._Rbore = value + + Rbore = property( + fget=_get_Rbore, + fset=_set_Rbore, + doc=u"""Radius at slot / airgap interface + + :Type: float + :min: 0 + """, + ) + + def _get_number_per_a(self): + """getter of number_per_a""" + return self._number_per_a + + def _set_number_per_a(self, value): + """setter of number_per_a""" + check_var("number_per_a", value, "int", Vmin=1) + self._number_per_a = value + + number_per_a = property( + fget=_get_number_per_a, + fset=_set_number_per_a, + doc=u"""Number of subdomains accounting for spatial (anti-)periodicity + + :Type: int + :min: 1 + """, + ) diff --git a/pyleecan/Classes/Subdomain_SlotOpening.py b/pyleecan/Classes/Subdomain_SlotOpening.py new file mode 100644 index 000000000..529238e35 --- /dev/null +++ b/pyleecan/Classes/Subdomain_SlotOpening.py @@ -0,0 +1,676 @@ +# -*- coding: utf-8 -*- +# File generated according to Generator/ClassesRef/Simulation/Subdomain_SlotOpening.csv +# WARNING! All changes made in this file will be lost! +"""Method code available at https://github.com/Eomys/pyleecan/tree/master/pyleecan/Methods/Simulation/Subdomain_SlotOpening +""" + +from os import linesep +from sys import getsizeof +from logging import getLogger +from ._check import set_array, check_var, raise_ +from ..Functions.get_logger import get_logger +from ..Functions.save import save +from ..Functions.load import load_init_dict +from ..Functions.Load.import_class import import_class +from copy import deepcopy +from .Subdomain_Slot import Subdomain_Slot + +# Import all class method +# Try/catch to remove unnecessary dependencies in unused method +try: + from ..Methods.Simulation.Subdomain_SlotOpening.add_constants_numbers import ( + add_constants_numbers, + ) +except ImportError as error: + add_constants_numbers = error + +try: + from ..Methods.Simulation.Subdomain_SlotOpening.comp_flux_density import ( + comp_flux_density, + ) +except ImportError as error: + comp_flux_density = error + + +from numpy import array, array_equal +from numpy import isnan +from ._check import InitUnKnowClassError + + +class Subdomain_SlotOpening(Subdomain_Slot): + """Subdomain class for slots regions""" + + VERSION = 1 + + # Check ImportError to remove unnecessary dependencies in unused method + # cf Methods.Simulation.Subdomain_SlotOpening.add_constants_numbers + if isinstance(add_constants_numbers, ImportError): + add_constants_numbers = property( + fget=lambda x: raise_( + ImportError( + "Can't use Subdomain_SlotOpening method add_constants_numbers: " + + str(add_constants_numbers) + ) + ) + ) + else: + add_constants_numbers = add_constants_numbers + # cf Methods.Simulation.Subdomain_SlotOpening.comp_flux_density + if isinstance(comp_flux_density, ImportError): + comp_flux_density = property( + fget=lambda x: raise_( + ImportError( + "Can't use Subdomain_SlotOpening method comp_flux_density: " + + str(comp_flux_density) + ) + ) + ) + else: + comp_flux_density = comp_flux_density + # generic save method is available in all object + save = save + # get_logger method is available in all object + get_logger = get_logger + + def __init__( + self, + C=None, + D=None, + E=None, + F=None, + opening_width=None, + v=None, + Ropening=None, + A=None, + B=None, + center_angle=None, + slot_width=None, + Ji=None, + Jik=None, + Ryoke=None, + Rbore=None, + number_per_a=None, + k=None, + number=None, + permeability_relative=1, + init_dict=None, + init_str=None, + ): + """Constructor of the class. Can be use in three ways : + - __init__ (arg1 = 1, arg3 = 5) every parameters have name and default values + for pyleecan type, -1 will call the default constructor + - __init__ (init_dict = d) d must be a dictionary with property names as keys + - __init__ (init_str = s) s must be a string + s is the file path to load + + ndarray or list can be given for Vector and Matrix + object or dict can be given for pyleecan Object""" + + if init_str is not None: # Load from a file + init_dict = load_init_dict(init_str)[1] + if init_dict is not None: # Initialisation by dict + assert type(init_dict) is dict + # Overwrite default value with init_dict content + if "C" in list(init_dict.keys()): + C = init_dict["C"] + if "D" in list(init_dict.keys()): + D = init_dict["D"] + if "E" in list(init_dict.keys()): + E = init_dict["E"] + if "F" in list(init_dict.keys()): + F = init_dict["F"] + if "opening_width" in list(init_dict.keys()): + opening_width = init_dict["opening_width"] + if "v" in list(init_dict.keys()): + v = init_dict["v"] + if "Ropening" in list(init_dict.keys()): + Ropening = init_dict["Ropening"] + if "A" in list(init_dict.keys()): + A = init_dict["A"] + if "B" in list(init_dict.keys()): + B = init_dict["B"] + if "center_angle" in list(init_dict.keys()): + center_angle = init_dict["center_angle"] + if "slot_width" in list(init_dict.keys()): + slot_width = init_dict["slot_width"] + if "Ji" in list(init_dict.keys()): + Ji = init_dict["Ji"] + if "Jik" in list(init_dict.keys()): + Jik = init_dict["Jik"] + if "Ryoke" in list(init_dict.keys()): + Ryoke = init_dict["Ryoke"] + if "Rbore" in list(init_dict.keys()): + Rbore = init_dict["Rbore"] + if "number_per_a" in list(init_dict.keys()): + number_per_a = init_dict["number_per_a"] + if "k" in list(init_dict.keys()): + k = init_dict["k"] + if "number" in list(init_dict.keys()): + number = init_dict["number"] + if "permeability_relative" in list(init_dict.keys()): + permeability_relative = init_dict["permeability_relative"] + # Set the properties (value check and convertion are done in setter) + self.C = C + self.D = D + self.E = E + self.F = F + self.opening_width = opening_width + self.v = v + self.Ropening = Ropening + # Call Subdomain_Slot init + super(Subdomain_SlotOpening, self).__init__( + A=A, + B=B, + center_angle=center_angle, + slot_width=slot_width, + Ji=Ji, + Jik=Jik, + Ryoke=Ryoke, + Rbore=Rbore, + number_per_a=number_per_a, + k=k, + number=number, + permeability_relative=permeability_relative, + ) + # The class is frozen (in Subdomain_Slot init), for now it's impossible to + # add new properties + + def __str__(self): + """Convert this object in a readeable string (for print)""" + + Subdomain_SlotOpening_str = "" + # Get the properties inherited from Subdomain_Slot + Subdomain_SlotOpening_str += super(Subdomain_SlotOpening, self).__str__() + Subdomain_SlotOpening_str += ( + "C = " + + linesep + + str(self.C).replace(linesep, linesep + "\t") + + linesep + + linesep + ) + Subdomain_SlotOpening_str += ( + "D = " + + linesep + + str(self.D).replace(linesep, linesep + "\t") + + linesep + + linesep + ) + Subdomain_SlotOpening_str += ( + "E = " + + linesep + + str(self.E).replace(linesep, linesep + "\t") + + linesep + + linesep + ) + Subdomain_SlotOpening_str += ( + "F = " + + linesep + + str(self.F).replace(linesep, linesep + "\t") + + linesep + + linesep + ) + Subdomain_SlotOpening_str += ( + "opening_width = " + str(self.opening_width) + linesep + ) + Subdomain_SlotOpening_str += ( + "v = " + + linesep + + str(self.v).replace(linesep, linesep + "\t") + + linesep + + linesep + ) + Subdomain_SlotOpening_str += "Ropening = " + str(self.Ropening) + linesep + return Subdomain_SlotOpening_str + + def __eq__(self, other): + """Compare two objects (skip parent)""" + + if type(other) != type(self): + return False + + # Check the properties inherited from Subdomain_Slot + if not super(Subdomain_SlotOpening, self).__eq__(other): + return False + if not array_equal(other.C, self.C): + return False + if not array_equal(other.D, self.D): + return False + if not array_equal(other.E, self.E): + return False + if not array_equal(other.F, self.F): + return False + if other.opening_width != self.opening_width: + return False + if not array_equal(other.v, self.v): + return False + if other.Ropening != self.Ropening: + return False + return True + + def compare(self, other, name="self", ignore_list=None, is_add_value=False): + """Compare two objects and return list of differences""" + + if ignore_list is None: + ignore_list = list() + if type(other) != type(self): + return ["type(" + name + ")"] + diff_list = list() + + # Check the properties inherited from Subdomain_Slot + diff_list.extend( + super(Subdomain_SlotOpening, self).compare( + other, name=name, ignore_list=ignore_list, is_add_value=is_add_value + ) + ) + if not array_equal(other.C, self.C): + diff_list.append(name + ".C") + if not array_equal(other.D, self.D): + diff_list.append(name + ".D") + if not array_equal(other.E, self.E): + diff_list.append(name + ".E") + if not array_equal(other.F, self.F): + diff_list.append(name + ".F") + if ( + other._opening_width is not None + and self._opening_width is not None + and isnan(other._opening_width) + and isnan(self._opening_width) + ): + pass + elif other._opening_width != self._opening_width: + if is_add_value: + val_str = ( + " (self=" + + str(self._opening_width) + + ", other=" + + str(other._opening_width) + + ")" + ) + diff_list.append(name + ".opening_width" + val_str) + else: + diff_list.append(name + ".opening_width") + if not array_equal(other.v, self.v): + diff_list.append(name + ".v") + if ( + other._Ropening is not None + and self._Ropening is not None + and isnan(other._Ropening) + and isnan(self._Ropening) + ): + pass + elif other._Ropening != self._Ropening: + if is_add_value: + val_str = ( + " (self=" + + str(self._Ropening) + + ", other=" + + str(other._Ropening) + + ")" + ) + diff_list.append(name + ".Ropening" + val_str) + else: + diff_list.append(name + ".Ropening") + # Filter ignore differences + diff_list = list(filter(lambda x: x not in ignore_list, diff_list)) + return diff_list + + def __sizeof__(self): + """Return the size in memory of the object (including all subobject)""" + + S = 0 # Full size of the object + + # Get size of the properties inherited from Subdomain_Slot + S += super(Subdomain_SlotOpening, self).__sizeof__() + S += getsizeof(self.C) + S += getsizeof(self.D) + S += getsizeof(self.E) + S += getsizeof(self.F) + S += getsizeof(self.opening_width) + S += getsizeof(self.v) + S += getsizeof(self.Ropening) + return S + + def as_dict(self, type_handle_ndarray=0, keep_function=False, **kwargs): + """ + Convert this object in a json serializable dict (can be use in __init__). + type_handle_ndarray: int + How to handle ndarray (0: tolist, 1: copy, 2: nothing) + keep_function : bool + True to keep the function object, else return str + Optional keyword input parameter is for internal use only + and may prevent json serializability. + """ + + # Get the properties inherited from Subdomain_Slot + Subdomain_SlotOpening_dict = super(Subdomain_SlotOpening, self).as_dict( + type_handle_ndarray=type_handle_ndarray, + keep_function=keep_function, + **kwargs + ) + if self.C is None: + Subdomain_SlotOpening_dict["C"] = None + else: + if type_handle_ndarray == 0: + Subdomain_SlotOpening_dict["C"] = self.C.tolist() + elif type_handle_ndarray == 1: + Subdomain_SlotOpening_dict["C"] = self.C.copy() + elif type_handle_ndarray == 2: + Subdomain_SlotOpening_dict["C"] = self.C + else: + raise Exception( + "Unknown type_handle_ndarray: " + str(type_handle_ndarray) + ) + if self.D is None: + Subdomain_SlotOpening_dict["D"] = None + else: + if type_handle_ndarray == 0: + Subdomain_SlotOpening_dict["D"] = self.D.tolist() + elif type_handle_ndarray == 1: + Subdomain_SlotOpening_dict["D"] = self.D.copy() + elif type_handle_ndarray == 2: + Subdomain_SlotOpening_dict["D"] = self.D + else: + raise Exception( + "Unknown type_handle_ndarray: " + str(type_handle_ndarray) + ) + if self.E is None: + Subdomain_SlotOpening_dict["E"] = None + else: + if type_handle_ndarray == 0: + Subdomain_SlotOpening_dict["E"] = self.E.tolist() + elif type_handle_ndarray == 1: + Subdomain_SlotOpening_dict["E"] = self.E.copy() + elif type_handle_ndarray == 2: + Subdomain_SlotOpening_dict["E"] = self.E + else: + raise Exception( + "Unknown type_handle_ndarray: " + str(type_handle_ndarray) + ) + if self.F is None: + Subdomain_SlotOpening_dict["F"] = None + else: + if type_handle_ndarray == 0: + Subdomain_SlotOpening_dict["F"] = self.F.tolist() + elif type_handle_ndarray == 1: + Subdomain_SlotOpening_dict["F"] = self.F.copy() + elif type_handle_ndarray == 2: + Subdomain_SlotOpening_dict["F"] = self.F + else: + raise Exception( + "Unknown type_handle_ndarray: " + str(type_handle_ndarray) + ) + Subdomain_SlotOpening_dict["opening_width"] = self.opening_width + if self.v is None: + Subdomain_SlotOpening_dict["v"] = None + else: + if type_handle_ndarray == 0: + Subdomain_SlotOpening_dict["v"] = self.v.tolist() + elif type_handle_ndarray == 1: + Subdomain_SlotOpening_dict["v"] = self.v.copy() + elif type_handle_ndarray == 2: + Subdomain_SlotOpening_dict["v"] = self.v + else: + raise Exception( + "Unknown type_handle_ndarray: " + str(type_handle_ndarray) + ) + Subdomain_SlotOpening_dict["Ropening"] = self.Ropening + # The class name is added to the dict for deserialisation purpose + # Overwrite the mother class name + Subdomain_SlotOpening_dict["__class__"] = "Subdomain_SlotOpening" + return Subdomain_SlotOpening_dict + + def copy(self): + """Creates a deepcopy of the object""" + + # Handle deepcopy of all the properties + if self.C is None: + C_val = None + else: + C_val = self.C.copy() + if self.D is None: + D_val = None + else: + D_val = self.D.copy() + if self.E is None: + E_val = None + else: + E_val = self.E.copy() + if self.F is None: + F_val = None + else: + F_val = self.F.copy() + opening_width_val = self.opening_width + if self.v is None: + v_val = None + else: + v_val = self.v.copy() + Ropening_val = self.Ropening + if self.A is None: + A_val = None + else: + A_val = self.A.copy() + if self.B is None: + B_val = None + else: + B_val = self.B.copy() + if self.center_angle is None: + center_angle_val = None + else: + center_angle_val = self.center_angle.copy() + slot_width_val = self.slot_width + if self.Ji is None: + Ji_val = None + else: + Ji_val = self.Ji.copy() + if self.Jik is None: + Jik_val = None + else: + Jik_val = self.Jik.copy() + Ryoke_val = self.Ryoke + Rbore_val = self.Rbore + number_per_a_val = self.number_per_a + if self.k is None: + k_val = None + else: + k_val = self.k.copy() + number_val = self.number + permeability_relative_val = self.permeability_relative + # Creates new object of the same type with the copied properties + obj_copy = type(self)( + C=C_val, + D=D_val, + E=E_val, + F=F_val, + opening_width=opening_width_val, + v=v_val, + Ropening=Ropening_val, + A=A_val, + B=B_val, + center_angle=center_angle_val, + slot_width=slot_width_val, + Ji=Ji_val, + Jik=Jik_val, + Ryoke=Ryoke_val, + Rbore=Rbore_val, + number_per_a=number_per_a_val, + k=k_val, + number=number_val, + permeability_relative=permeability_relative_val, + ) + return obj_copy + + def _set_None(self): + """Set all the properties to None (except pyleecan object)""" + + self.C = None + self.D = None + self.E = None + self.F = None + self.opening_width = None + self.v = None + self.Ropening = None + # Set to None the properties inherited from Subdomain_Slot + super(Subdomain_SlotOpening, self)._set_None() + + def _get_C(self): + """getter of C""" + return self._C + + def _set_C(self, value): + """setter of C""" + if type(value) is int and value == -1: + value = array([]) + elif type(value) is list: + try: + value = array(value) + except: + pass + check_var("C", value, "ndarray") + self._C = value + + C = property( + fget=_get_C, + fset=_set_C, + doc=u"""First integration constant function of harmonic number and time in slot opening subdomain + + :Type: ndarray + """, + ) + + def _get_D(self): + """getter of D""" + return self._D + + def _set_D(self, value): + """setter of D""" + if type(value) is int and value == -1: + value = array([]) + elif type(value) is list: + try: + value = array(value) + except: + pass + check_var("D", value, "ndarray") + self._D = value + + D = property( + fget=_get_D, + fset=_set_D, + doc=u"""Second integration constant function of harmonic number and time in slot opening subdomain + + :Type: ndarray + """, + ) + + def _get_E(self): + """getter of E""" + return self._E + + def _set_E(self, value): + """setter of E""" + if type(value) is int and value == -1: + value = array([]) + elif type(value) is list: + try: + value = array(value) + except: + pass + check_var("E", value, "ndarray") + self._E = value + + E = property( + fget=_get_E, + fset=_set_E, + doc=u"""Third integration constant function of harmonic number and time in slot opening subdomain + + :Type: ndarray + """, + ) + + def _get_F(self): + """getter of F""" + return self._F + + def _set_F(self, value): + """setter of F""" + if type(value) is int and value == -1: + value = array([]) + elif type(value) is list: + try: + value = array(value) + except: + pass + check_var("F", value, "ndarray") + self._F = value + + F = property( + fget=_get_F, + fset=_set_F, + doc=u"""Fourth integration constant function of harmonic number and time in slot opening subdomain + + :Type: ndarray + """, + ) + + def _get_opening_width(self): + """getter of opening_width""" + return self._opening_width + + def _set_opening_width(self, value): + """setter of opening_width""" + check_var("opening_width", value, "float", Vmin=0) + self._opening_width = value + + opening_width = property( + fget=_get_opening_width, + fset=_set_opening_width, + doc=u"""Angular width of slot opening + + :Type: float + :min: 0 + """, + ) + + def _get_v(self): + """getter of v""" + return self._v + + def _set_v(self, value): + """setter of v""" + if type(value) is int and value == -1: + value = array([]) + elif type(value) is list: + try: + value = array(value) + except: + pass + check_var("v", value, "ndarray") + self._v = value + + v = property( + fget=_get_v, + fset=_set_v, + doc=u"""Harmonic vector for slot opening + + :Type: ndarray + """, + ) + + def _get_Ropening(self): + """getter of Ropening""" + return self._Ropening + + def _set_Ropening(self, value): + """setter of Ropening""" + check_var("Ropening", value, "float", Vmin=0) + self._Ropening = value + + Ropening = property( + fget=_get_Ropening, + fset=_set_Ropening, + doc=u"""Radius of slot opening / slot interface + + :Type: float + :min: 0 + """, + ) diff --git a/pyleecan/Classes/import_all.py b/pyleecan/Classes/import_all.py index 4d470ca10..a0acf07e2 100644 --- a/pyleecan/Classes/import_all.py +++ b/pyleecan/Classes/import_all.py @@ -123,6 +123,7 @@ from ..Classes.MachineWRSM import MachineWRSM from ..Classes.MagElmer import MagElmer from ..Classes.MagFEMM import MagFEMM +from ..Classes.MagSDM import MagSDM from ..Classes.Magnet import Magnet from ..Classes.Magnetics import Magnetics from ..Classes.MatEconomical import MatEconomical @@ -241,6 +242,13 @@ from ..Classes.SolverInputFile import SolverInputFile from ..Classes.StructElmer import StructElmer from ..Classes.Structural import Structural +from ..Classes.Subdomain import Subdomain +from ..Classes.SubdomainModel import SubdomainModel +from ..Classes.SubdomainModel_SPMSM import SubdomainModel_SPMSM +from ..Classes.Subdomain_Airgap import Subdomain_Airgap +from ..Classes.Subdomain_MagnetSurface import Subdomain_MagnetSurface +from ..Classes.Subdomain_Slot import Subdomain_Slot +from ..Classes.Subdomain_SlotOpening import Subdomain_SlotOpening from ..Classes.SurfLine import SurfLine from ..Classes.SurfRing import SurfRing from ..Classes.Surface import Surface diff --git a/pyleecan/Functions/SubdomainModel/E.py b/pyleecan/Functions/SubdomainModel/E.py new file mode 100644 index 000000000..afa5e77f2 --- /dev/null +++ b/pyleecan/Functions/SubdomainModel/E.py @@ -0,0 +1,2 @@ +def E(n, r, R): + return (r / R) ** n - (R / r) ** n diff --git a/pyleecan/Functions/SubdomainModel/I_ckni.py b/pyleecan/Functions/SubdomainModel/I_ckni.py new file mode 100644 index 000000000..2e19c3e81 --- /dev/null +++ b/pyleecan/Functions/SubdomainModel/I_ckni.py @@ -0,0 +1,32 @@ +from numpy import pi, sin, cos, abs as np_abs, any as np_any + + +def I_ckni(a, nik, kni, theta_ikn, per_a=1, is_antiper_a=False): + val = ( + a**2 + * nik + * ( + (-1) ** kni * sin(nik * (a + 2 * theta_ikn) / 2) + + sin(nik * (a - 2 * theta_ikn) / 2) + ) + / (a**2 * nik**2 - pi**2 * kni**2) + ) + + ind0 = np_abs(nik - kni * pi / a) < 1e-5 + + if np_any(ind0): + niv1 = nik[ind0] + theta_ikn1 = theta_ikn[ind0] + + val[ind0] = ( + 2 * a * niv1 * cos(a * niv1 / 2 - niv1 * theta_ikn1) + + sin(niv1 * (a / 2 - theta_ikn1)) + + sin(3 * a * niv1 / 2 + niv1 * theta_ikn1) + ) / (4 * niv1) + + if is_antiper_a: + val_a = val - I_ckni(a, nik, kni, theta_ikn + pi / per_a) + return val.T, val_a + + else: + return val.T, val diff --git a/pyleecan/Functions/SubdomainModel/I_cni.py b/pyleecan/Functions/SubdomainModel/I_cni.py new file mode 100644 index 000000000..0cc26d246 --- /dev/null +++ b/pyleecan/Functions/SubdomainModel/I_cni.py @@ -0,0 +1,12 @@ +from numpy import pi, sin, cos + + +def I_cni(a, ni, theta_in, per_a=1, is_antiper_a=False): + val = 2 * sin(a * ni / 2) * cos(theta_in * ni) / ni + + if is_antiper_a: + val_a = val - I_cni(a, ni, theta_in + pi / per_a) + return val, val_a.T + + else: + return val, val.T diff --git a/pyleecan/Functions/SubdomainModel/I_skni.py b/pyleecan/Functions/SubdomainModel/I_skni.py new file mode 100644 index 000000000..8dd4f467b --- /dev/null +++ b/pyleecan/Functions/SubdomainModel/I_skni.py @@ -0,0 +1,32 @@ +from numpy import pi, sin, cos, abs as np_abs, any as np_any + + +def I_skni(a, nik, kni, theta_ikn, per_a=1, is_antiper_a=False): + val = ( + a**2 + * nik + * ( + -((-1) ** kni) * cos(nik * (a + 2 * theta_ikn) / 2) + + cos(nik * (a - 2 * theta_ikn) / 2) + ) + / (a**2 * nik**2 - pi**2 * kni**2) + ) + + ind0 = np_abs(nik - kni * pi / a) < 1e-5 + + if np_any(ind0): + niv1 = nik[ind0] + theta_ikn1 = theta_ikn[ind0] + + val[ind0] = ( + -2 * a * niv1 * sin(a * niv1 / 2 - niv1 * theta_ikn1) + + cos(niv1 * (a / 2 - theta_ikn1)) + - cos(3 * a * niv1 / 2 + niv1 * theta_ikn1) + ) / (4 * niv1) + + if is_antiper_a: + val_a = val - I_skni(a, nik, kni, theta_ikn + pi / per_a) + return val.T, val_a + + else: + return val.T, val diff --git a/pyleecan/Functions/SubdomainModel/I_sni.py b/pyleecan/Functions/SubdomainModel/I_sni.py new file mode 100644 index 000000000..5e4c22790 --- /dev/null +++ b/pyleecan/Functions/SubdomainModel/I_sni.py @@ -0,0 +1,12 @@ +from numpy import pi, sin, cos + + +def I_sni(a, ni, theta_in, per_a=1, is_antiper_a=False): + val = 2 * sin(a * ni / 2) * sin(theta_in * ni) / ni + + if is_antiper_a: + val_a = val - I_sni(a, ni, theta_in + pi / per_a) + return val, val_a.T + + else: + return val, val.T diff --git a/pyleecan/Functions/SubdomainModel/P.py b/pyleecan/Functions/SubdomainModel/P.py new file mode 100644 index 000000000..75c3a3a41 --- /dev/null +++ b/pyleecan/Functions/SubdomainModel/P.py @@ -0,0 +1,2 @@ +def P(n, r, R): + return (r / R) ** n + (R / r) ** n diff --git a/pyleecan/Functions/load_switch.py b/pyleecan/Functions/load_switch.py index e0f5ab3ab..6deaf10c3 100644 --- a/pyleecan/Functions/load_switch.py +++ b/pyleecan/Functions/load_switch.py @@ -125,6 +125,7 @@ "MachineWRSM": MachineWRSM, "MagElmer": MagElmer, "MagFEMM": MagFEMM, + "MagSDM": MagSDM, "Magnet": Magnet, "Magnetics": Magnetics, "MatEconomical": MatEconomical, @@ -243,6 +244,13 @@ "SolverInputFile": SolverInputFile, "StructElmer": StructElmer, "Structural": Structural, + "Subdomain": Subdomain, + "SubdomainModel": SubdomainModel, + "SubdomainModel_SPMSM": SubdomainModel_SPMSM, + "Subdomain_Airgap": Subdomain_Airgap, + "Subdomain_MagnetSurface": Subdomain_MagnetSurface, + "Subdomain_Slot": Subdomain_Slot, + "Subdomain_SlotOpening": Subdomain_SlotOpening, "SurfLine": SurfLine, "SurfRing": SurfRing, "Surface": Surface, diff --git a/pyleecan/GUI/Dialog/DClassGenerator/DClassGenerator.py b/pyleecan/GUI/Dialog/DClassGenerator/DClassGenerator.py index 12a0682e7..8b5eaba6c 100644 --- a/pyleecan/GUI/Dialog/DClassGenerator/DClassGenerator.py +++ b/pyleecan/GUI/Dialog/DClassGenerator/DClassGenerator.py @@ -2252,7 +2252,7 @@ def is_app(app_path): # Check if file exists if isfile(app_path): return True - + # Check in all folders of environment path if file exists else: for dir in os.environ["PATH"].split(os.pathsep): @@ -2260,4 +2260,3 @@ def is_app(app_path): return True return False - diff --git a/pyleecan/Generator/ClassesRef/Machine/LamSlotMag.csv b/pyleecan/Generator/ClassesRef/Machine/LamSlotMag.csv index 4f46d5d03..46a11f879 100644 --- a/pyleecan/Generator/ClassesRef/Machine/LamSlotMag.csv +++ b/pyleecan/Generator/ClassesRef/Machine/LamSlotMag.csv @@ -9,4 +9,5 @@ Machine,LamSlotM,build_geometry,VERSION,1,Lamination with Slot for Magnets,,, ,,comp_volumes,,,,,, ,,get_all_mag_obj,,,,,, ,,get_magnet_by_label,,,,,, +,,get_polar_eq,,,,,, ,,set_Lmag,,,,,, diff --git a/pyleecan/Generator/ClassesRef/Simulation/MagSDM.csv b/pyleecan/Generator/ClassesRef/Simulation/MagSDM.csv new file mode 100644 index 000000000..743b7b383 --- /dev/null +++ b/pyleecan/Generator/ClassesRef/Simulation/MagSDM.csv @@ -0,0 +1,6 @@ +Variable name,Unit,Description (EN),Size,Type,Default value,Minimum value,Maximum value,as_dict Type +subdomain_model,,The subdomain model object defined to calculate airgap flux density,,SubdomainModel,None,,, +Nharm_coeff,,Scaling coefficient to calculate more or less harmonics in subdomains,,float,1,0,, +,,,,,,,, +Package,Inherit,Methods,Constant Name,Constant Value,Class description,,, +Simulation,Magnetics,comp_flux_airgap,VERSION,1,,,, diff --git a/pyleecan/Generator/ClassesRef/Simulation/Subdomain.csv b/pyleecan/Generator/ClassesRef/Simulation/Subdomain.csv new file mode 100644 index 000000000..73fe777b4 --- /dev/null +++ b/pyleecan/Generator/ClassesRef/Simulation/Subdomain.csv @@ -0,0 +1,7 @@ +Variable name,Unit,Description (EN),Size,Type,Default value,Minimum value,Maximum value,as_dict Type +k,,Array of harmonic numbers ,,ndarray,None,0,, +number,,Number of identical subdomains in model,,int,None,0,, +permeability_relative,,Relative permeability of subdomain,,float,1,1,, +,,,,,,,, +Package,Inherit,Methods,Constant Name,Constant Value,Class description,,, +Simulation,,,VERSION,1,Abstract class for all subdomains,,, diff --git a/pyleecan/Generator/ClassesRef/Simulation/SubdomainModel.csv b/pyleecan/Generator/ClassesRef/Simulation/SubdomainModel.csv new file mode 100644 index 000000000..d14836813 --- /dev/null +++ b/pyleecan/Generator/ClassesRef/Simulation/SubdomainModel.csv @@ -0,0 +1,12 @@ +Variable name,Unit,Description (EN),Size,Type,Default value,Minimum value,Maximum value,as_dict Type +airgap,,Airgap subdomain,,Subdomain_Airgap,None,,, +per_a,,Spatial periodicity factor,,int,None,1,, +machine_polar_eq,,Polar equivalent of machine,,Machine,None,,, +is_antiper_a,,True if there is spatial anti-periodicity,,bool,None,,, +mat,,Topological matrix,,ndarray,None,,, +vect,,Source vector,,ndarray,None,,, +csts_number,,List of constants number,,list,None,,, +csts_position,,List of constants positions in topoligical matrix,,list,None,,, +,,,,,,,, +Package,Inherit,Methods,Constant Name,Constant Value,Class description,,, +Simulation,,,VERSION,1,Abstract class for all the Subdomain model classes,,, diff --git a/pyleecan/Generator/ClassesRef/Simulation/SubdomainModel_SPMSM.csv b/pyleecan/Generator/ClassesRef/Simulation/SubdomainModel_SPMSM.csv new file mode 100644 index 000000000..c53fc7612 --- /dev/null +++ b/pyleecan/Generator/ClassesRef/Simulation/SubdomainModel_SPMSM.csv @@ -0,0 +1,9 @@ +Variable name,Unit,Description (EN),Size,Type,Default value,Minimum value,Maximum value,as_dict Type +stator_slot,,Subdomain for stator slots,,Subdomain_Slot,None,,, +rotor_magnet_surface,,Subdomain for surface magnets,,Subdomain_MagnetSurface,None,,, +rotor_yoke,,Subdomain for rotor yoke,,Subdomain,None,,, +,,,,,,,, +Package,Inherit,Methods,Constant Name,Constant Value,Class description,,, +Simulation,SubdomainModel,set_subdomains,VERSION,1,Subdomain model for Surface Permanent Magnet Synchronous Machine assuming infinite permeability in yokes,,, +,,solve,,,,,, +,,store_constants,,,,,, diff --git a/pyleecan/Generator/ClassesRef/Simulation/Subdomain_Airgap.csv b/pyleecan/Generator/ClassesRef/Simulation/Subdomain_Airgap.csv new file mode 100644 index 000000000..19bdac644 --- /dev/null +++ b/pyleecan/Generator/ClassesRef/Simulation/Subdomain_Airgap.csv @@ -0,0 +1,12 @@ +Variable name,Unit,Description (EN),Size,Type,Default value,Minimum value,Maximum value,as_dict Type +A,,First integration constant function of harmonic number and time,"[K, Nt]",ndarray,None,,, +B,,Second integration constant function of harmonic number and time,"[K, Nt]",ndarray,None,,, +C,,Third integration constant function of harmonic number and time,"[K, Nt]",ndarray,None,,, +D,,Fourth integration constant function of harmonic number and time,"[K, Nt]",ndarray,None,,, +Rrbo,,Rotor bore radius,,float,None,,, +Rsbo,,Stator bore radius,,float,None,,, +,,,,,,,, +Package,Inherit,Methods,Constant Name,Constant Value,Class description,,, +Simulation,Subdomain,add_constants_numbers,VERSION,1,Subdomain class for airgap region,,, +,,comp_flux_density,,,,,, +,,comp_torque,,,,,, diff --git a/pyleecan/Generator/ClassesRef/Simulation/Subdomain_MagnetSurface.csv b/pyleecan/Generator/ClassesRef/Simulation/Subdomain_MagnetSurface.csv new file mode 100644 index 000000000..4a068bc56 --- /dev/null +++ b/pyleecan/Generator/ClassesRef/Simulation/Subdomain_MagnetSurface.csv @@ -0,0 +1,18 @@ +Variable name,Unit,Description (EN),Size,Type,Default value,Minimum value,Maximum value,as_dict Type +type_magnetization,,Magnetization type given by machine properties,,int,0,0,3, +magnet_width,rad,Angular width of a magnet,,float,None,0,, +Ryoke,m,Radius at magnet / yoke interface,,float,None,0,, +A,,First integration constant function of harmonic number and time,,ndarray,None,,, +B,,Second integration constant function of harmonic number and time,,ndarray,None,,, +C,,Third integration constant function of harmonic number and time,,ndarray,None,,, +D,,Fourth integration constant function of harmonic number and time,,ndarray,None,,, +Rbore,m,Radius at magnet / airgap interface,,float,None,0,, +Mrn,,Fourier series of radial magnetization,,ndarray,None,,, +Mtn,,Fourier series of circumferential magnetization,,ndarray,None,,, +,,,,,,,, +Package,Inherit,Methods,Constant Name,Constant Value,Class description,,, +Simulation,Subdomain,add_constants_numbers,VERSION,1,Subdomain class for surface permanent magnet region,,, +,,comp_flux_density,,,,,, +,,comp_interface_airgap,,,,,, +,,comp_magnet_solution,,,,,, +,,comp_magnet_source,,,,,, diff --git a/pyleecan/Generator/ClassesRef/Simulation/Subdomain_Slot.csv b/pyleecan/Generator/ClassesRef/Simulation/Subdomain_Slot.csv new file mode 100644 index 000000000..9a850de60 --- /dev/null +++ b/pyleecan/Generator/ClassesRef/Simulation/Subdomain_Slot.csv @@ -0,0 +1,18 @@ +Variable name,Unit,Description (EN),Size,Type,Default value,Minimum value,Maximum value,as_dict Type +A,,First integration constant function of harmonic number and time,"[Zs, Nt]",ndarray,None,,, +B,,Second integration constant function of harmonic number and time,"[K*Zs, Nt]",ndarray,None,,, +center_angle,rad,Angle value at slot center,,ndarray,None,,, +slot_width,rad,Angular width of slot,,float,None,0,, +Ji,A/m^2,Average current density in slots,"[Zs, Nt]",ndarray,None,,, +Jik,A/m^2,Current density space harmonics in slots for concentrated double layer windings,"[K*Zs, Nt]",ndarray,None,,, +Ryoke,m,Radius at slot / yoke interface,,float,None,0,, +Rbore,m,Radius at slot / airgap interface,,float,None,0,, +number_per_a,,Number of subdomains accounting for spatial (anti-)periodicity,,int,None,1,, +,,,,,,,, +Package,Inherit,Methods,Constant Name,Constant Value,Class description,,, +Simulation,Subdomain,add_constants_numbers,VERSION,1,Subdomain class for slots regions without openings and with windings,,, +,,comp_current_solution,,,,,, +,,comp_current_source,,,,,, +,,comp_flux_density,,,,,, +,,comp_interface_airgap,,,,,, +,,comp_Phi_wind,,,,,, diff --git a/pyleecan/Generator/ClassesRef/Simulation/Subdomain_SlotOpening.csv b/pyleecan/Generator/ClassesRef/Simulation/Subdomain_SlotOpening.csv new file mode 100644 index 000000000..6ec326cc0 --- /dev/null +++ b/pyleecan/Generator/ClassesRef/Simulation/Subdomain_SlotOpening.csv @@ -0,0 +1,12 @@ +Variable name,Unit,Description (EN),Size,Type,Default value,Minimum value,Maximum value,as_dict Type +C,,First integration constant function of harmonic number and time in slot opening subdomain,"[Zs, Nt]",ndarray,None,,, +D,,Second integration constant function of harmonic number and time in slot opening subdomain,"[Zs, Nt]",ndarray,None,,, +E,,Third integration constant function of harmonic number and time in slot opening subdomain,"[V*Zs, Nt]",ndarray,None,,, +F,,Fourth integration constant function of harmonic number and time in slot opening subdomain,"[V*Zs, Nt]",ndarray,None,,, +opening_width,rad,Angular width of slot opening,,float,None,0,, +v,,Harmonic vector for slot opening,"[V,1]",ndarray,None,,, +Ropening,m,Radius of slot opening / slot interface,,float,None,0,, +,,,,,,,, +Package,Inherit,Methods,Constant Name,Constant Value,Class description,,, +Simulation,Subdomain_Slot,add_constants_numbers,VERSION,1,Subdomain class for slots regions,,, +,,comp_flux_density,,,,,, diff --git a/pyleecan/Generator/read_fct.py b/pyleecan/Generator/read_fct.py index 171d9d5b6..4ce4247ef 100644 --- a/pyleecan/Generator/read_fct.py +++ b/pyleecan/Generator/read_fct.py @@ -85,7 +85,9 @@ def read_all( gen_dict[file_name[:-4]]["is_internal"] = True # Update all the "daughters" key according to "mother" key - update_all_daughters(gen_dict, is_update_mother_of_mother=is_update_mother_of_mother) + update_all_daughters( + gen_dict, is_update_mother_of_mother=is_update_mother_of_mother + ) return gen_dict diff --git a/pyleecan/Generator/run_class_generator_GUI.py b/pyleecan/Generator/run_class_generator_GUI.py index 76ec1d441..034b95195 100644 --- a/pyleecan/Generator/run_class_generator_GUI.py +++ b/pyleecan/Generator/run_class_generator_GUI.py @@ -12,9 +12,9 @@ ## UPDATE paths to prefered applications # Path to prefered application to edit python files -PATH_EDITOR_PY = "notepad.exe" +PATH_EDITOR_PY = "C:/Users/emile/AppData/Local/Programs/Microsoft VS Code/Code.exe" # Path to prefered application to edit csv files -PATH_EDITOR_CSV = "notepad.exe" +PATH_EDITOR_CSV = "C:/Program Files/LibreOffice/program/scalc.exe" def run_class_generator(argv): diff --git a/pyleecan/Methods/Machine/LamSlotMag/get_polar_eq.py b/pyleecan/Methods/Machine/LamSlotMag/get_polar_eq.py new file mode 100644 index 000000000..fe7f7e73e --- /dev/null +++ b/pyleecan/Methods/Machine/LamSlotMag/get_polar_eq.py @@ -0,0 +1,40 @@ +import numpy as np + +from ....Classes.SlotM11 import SlotM11 +from ....Classes.SlotM18 import SlotM18 + + +def get_polar_eq(self): + """Returns a polar equivalent of the lamination + + Parameters + ---------- + self : LamSlotMag + A LamSlotMag object to convert to polar + + Returns + ------- + polar_eq: LamSlotMag + The polar equivalent of the lamination + """ + + # Copy the lamination + polar_eq = type(self)(init_dict=self.as_dict()) + + # Compute the polar dimension of the slot + Hmag = self.slot.comp_height_active() + H0 = self.slot.comp_height() + Wmag = self.slot.comp_angle_active_eq() + W0 = self.slot.comp_angle_opening() + + if np.isclose(Wmag, W0): + # Ring magnet + polar_eq.slot = SlotM18(Zs=self.slot.Zs, H0=Hmag) + else: + # Polar magnet + polar_eq.slot = SlotM11(Zs=self.slot.Zs, H1=Hmag, H0=H0, W1=Wmag, W0=W0) + + # TODO: Polar eq for ventilations ? + polar_eq.axial_vent = list() + + return polar_eq diff --git a/pyleecan/Methods/Simulation/MagFEMM/comp_flux_airgap.py b/pyleecan/Methods/Simulation/MagFEMM/comp_flux_airgap.py index 0d07a4eae..627e3b330 100644 --- a/pyleecan/Methods/Simulation/MagFEMM/comp_flux_airgap.py +++ b/pyleecan/Methods/Simulation/MagFEMM/comp_flux_airgap.py @@ -1,6 +1,3 @@ -from os.path import isfile -from shutil import copyfile - from numpy import zeros from SciDataTool import Data1D diff --git a/pyleecan/Methods/Simulation/MagSDM/comp_flux_airgap.py b/pyleecan/Methods/Simulation/MagSDM/comp_flux_airgap.py new file mode 100644 index 000000000..eb6350ae1 --- /dev/null +++ b/pyleecan/Methods/Simulation/MagSDM/comp_flux_airgap.py @@ -0,0 +1,82 @@ +from numpy import pi + + +from ....Classes.MachineSIPMSM import MachineSIPMSM +from ....Classes.SubdomainModel_SPMSM import SubdomainModel_SPMSM + + +def comp_flux_airgap(self, output, axes_dict, Is_val=None, Ir_val=None): + """Build and solve Subdomain model (SDM) to calculate and store magnetic quantities + + Parameters + ---------- + self : MagSDM + a MagSDM object + output : Output + an Output object + axes_dict: {Data} + Dict of axes used for magnetic calculation + + Returns + ------- + out_dict: dict + Dict containing the following quantities: + Br : ndarray + Airgap radial flux density (Nt,Na) [T] + Bt : ndarray + Airgap tangential flux density (Nt,Na) [T] + Tem : ndarray + Electromagnetic torque over time (Nt,) [Nm] + Phi_wind_stator : ndarray + Stator winding flux (qs,Nt) [Wb] + Phi_wind : dict + Dict of winding fluxlinkage with respect to Machine.get_lam_list_label (qs,Nt) [Wb] + meshsolution: MeshSolution + MeshSolution object containing magnetic quantities B, H, mu for each time step + """ + + logger = self.get_logger() + + # Init output + out_dict = dict() + + # Get time and angular axes + Angle = axes_dict["angle"] + Time = axes_dict["time"] + + # Set the angular symmetry factor according to the machine and check if it is anti-periodic + per_a, is_antiper_a = Angle.get_periodicity() + + # Import angular vector from Data object + angle = Angle.get_values( + is_oneperiod=self.is_periodicity_a, + is_antiperiod=is_antiper_a and self.is_periodicity_a, + ) + + # Check if the time axis is anti-periodic + _, is_antiper_t = Time.get_periodicity() + + # Number of time steps + time = Time.get_values( + is_oneperiod=self.is_periodicity_t, + is_antiperiod=is_antiper_t and self.is_periodicity_t, + ) + Nt = time.size + + # Get rotor angular position + angle_rotor = output.get_angle_rotor()[0:Nt] + + self.subdomain_model.per_a = per_a + self.subdomain_model.is_antiper_a = is_antiper_a + self.subdomain_model.machine_polar_eq = output.simu.machine.get_polar_eq() + + self.subdomain_model.set_subdomains(self.Nharm_coeff, Is_val, self.is_mmfr) + + ( + out_dict["B_{rad}"], + out_dict["B_{circ}"], + out_dict["Tem"], + out_dict["Phi_wind_stator"], + ) = self.subdomain_model.solve(angle, angle_rotor) + + return out_dict diff --git a/pyleecan/Methods/Simulation/MagSDM/init_sdm.py b/pyleecan/Methods/Simulation/MagSDM/init_sdm.py new file mode 100644 index 000000000..c18d4bc4a --- /dev/null +++ b/pyleecan/Methods/Simulation/MagSDM/init_sdm.py @@ -0,0 +1,17 @@ +def init_sdm(self): + """Method description + + Parameters + ---------- + self: MagSDM + a MagSDM object + + Returns + ---------- + var: type + var description + """ + + raise Exception("Method init_sdm not implemented yet") + + return var diff --git a/pyleecan/Methods/Simulation/SubdomainModel_SPMSM/set_subdomains.py b/pyleecan/Methods/Simulation/SubdomainModel_SPMSM/set_subdomains.py new file mode 100644 index 000000000..3e30467b8 --- /dev/null +++ b/pyleecan/Methods/Simulation/SubdomainModel_SPMSM/set_subdomains.py @@ -0,0 +1,89 @@ +from numpy import pi, arange, floor + +from ....Classes.Subdomain_Airgap import Subdomain_Airgap +from ....Classes.Subdomain_MagnetSurface import Subdomain_MagnetSurface +from ....Classes.Subdomain_Slot import Subdomain_Slot +from ....Classes.Subdomain_SlotOpening import Subdomain_SlotOpening + + +def set_subdomains(self, Nharm_coeff=1, Is_val=None, is_mmfr=True): + """Method to calcul + + Parameters + ---------- + self: SubdomainModel_SPMSM + a SubdomainModel_SPMSM object + + + """ + + # Init constants list + self.csts_number = list() + + per_a = self.per_a + antiper_a = 2 if self.is_antiper_a else 1 + polar_eq = self.machine_polar_eq + Rrbo = polar_eq.rotor.comp_radius_mec() + Rsbo = polar_eq.stator.comp_radius_mec() + Zs = polar_eq.stator.get_Zs() + Zs0 = int(Zs / per_a / antiper_a) + p = polar_eq.get_pole_pair_number() + + # Checking internal or external rotor + if polar_eq.rotor.is_internal: + sign_rot = 1 + else: + sign_rot = -1 + + # Define airgap subdomain + Nhag = floor(Nharm_coeff * 10 * Zs + p) + self.airgap = Subdomain_Airgap( + Rrbo=Rrbo, + Rsbo=Rsbo, + k=arange(per_a, Nhag, antiper_a * per_a, dtype=int), + ) + self.airgap.add_constants_numbers(self.csts_number) + + # Define rotor surface magnets subdomain + self.rotor_magnet_surface = Subdomain_MagnetSurface( + number=polar_eq.rotor.get_Zs(), + magnet_width=polar_eq.rotor.slot.comp_angle_active_eq(), + Rbore=Rrbo, + Ryoke=Rrbo - sign_rot * polar_eq.rotor.slot.comp_height_active(), + k=self.airgap.k, + ) + self.rotor_magnet_surface.comp_magnet_source(polar_eq.rotor, sign_rot) + if not is_mmfr: + self.rotor_magnet_surface.Mrn *= 0 + self.rotor_magnet_surface.Mtn *= 0 + + # Define stator slots subdomains + slotS = polar_eq.stator.slot + if slotS.H0 > 0: + self.stator_slot = Subdomain_SlotOpening() + else: + self.stator_slot = Subdomain_Slot() + Nhss = max([floor(slotS.W2 * Nhag / pi), 2]) + theta_i0 = 0 + self.stator_slot.number = Zs + self.stator_slot.number_per_a = Zs0 + self.stator_slot.center_angle = 2 * pi / Zs * arange(0, Zs0) + theta_i0 + self.stator_slot.slot_width = slotS.W2 + self.stator_slot.Rbore = Rsbo + self.stator_slot.Ryoke = Rsbo + sign_rot * (slotS.H0 + slotS.H2) + self.stator_slot.k = arange(1, Nhss, dtype=int) + if slotS.H0 > 0: + # Define stator slots opening subdomains + Nhso = max([floor(slotS.W0 * Nhag / pi), 2]) + self.stator_slot.Ropening = Rsbo + sign_rot * slotS.H0 + self.stator_slot.opening_width = slotS.W0 + self.stator_slot.v = arange(1, Nhso, dtype=int) + + self.stator_slot.comp_current_source(Is_val, polar_eq.stator) + self.stator_slot.add_constants_numbers(self.csts_number) + + # Calculate slice position of each constant in topological matrix and source vector + cp = [sum(self.csts_number[0:x:1]) for x in range(0, len(self.csts_number) + 1)] + self.csts_position = [ + slice(cp[x], cp[x + 1]) for x in range(0, len(self.csts_number)) + ] diff --git a/pyleecan/Methods/Simulation/SubdomainModel_SPMSM/solve.py b/pyleecan/Methods/Simulation/SubdomainModel_SPMSM/solve.py new file mode 100644 index 000000000..69fd9ad3e --- /dev/null +++ b/pyleecan/Methods/Simulation/SubdomainModel_SPMSM/solve.py @@ -0,0 +1,44 @@ +from numpy import zeros +from numpy.linalg import solve as np_solve + + +def solve(self, angle, angle_rotor): + """Method description + + Parameters + ---------- + self: SubdomainModel_SPMSM + a SubdomainModel_SPMSM object + + Returns + ---------- + var: type + var description + """ + + # Init topological matrix and source vector + Nmat = sum(self.csts_number) + self.mat = zeros((Nmat, Nmat)) + self.vect = zeros((Nmat, angle_rotor.size)) + + # Build interface conditions between rotor and airgap + self.rotor_magnet_surface.comp_interface_airgap(angle_rotor) + + # Build interface conditions between stator and airgap + self.stator_slot.comp_interface_airgap() + + # Solve linear system + Csts = np_solve(self.mat, self.vect) + + # Store integration constants in subdomain + self.store_constants(Csts) + + # Get airgap flux density at mean radius + Rag = (self.airgap.Rrbo + self.airgap.Rsbo) / 2 + Br, Btheta = self.airgap.comp_flux_density(Rag, angle) + + Tem = self.airgap.comp_torque() + + Phi_wind_stator = self.stator_slot.comp_Phi_wind() + + return Br, Btheta, Tem, Phi_wind_stator diff --git a/pyleecan/Methods/Simulation/SubdomainModel_SPMSM/store_constants.py b/pyleecan/Methods/Simulation/SubdomainModel_SPMSM/store_constants.py new file mode 100644 index 000000000..f87a9da53 --- /dev/null +++ b/pyleecan/Methods/Simulation/SubdomainModel_SPMSM/store_constants.py @@ -0,0 +1,41 @@ +from ....Functions.SubdomainModel.E import E +from ....Functions.SubdomainModel.P import P + + +def store_constants(self, Csts): + """Method description + + Parameters + ---------- + self: SubdomainModel_SPMSM + a SubdomainModel_SPMSM object + Csts: ndarray + Array containing integration constants values over time + + """ + + cp = self.csts_position + + # Airgap constants + self.airgap.A = Csts[cp[0], :] + self.airgap.C = Csts[cp[1], :] + self.airgap.B = Csts[cp[2], :] + self.airgap.D = Csts[cp[3], :] + + # Stator slots constants + self.stator_slot.A = Csts[cp[4], :] + self.stator_slot.B = Csts[cp[5], :] + + # Rebuild rotor surface magnet constants + R_3 = self.airgap.Rrbo + R_4 = self.airgap.Rsbo + nt = self.airgap.k[:, None] + P_nt_R3_R4, E_nt_R3_R4 = P(nt, R_3, R_4), E(nt, R_3, R_4) + + self.rotor_magnet_surface.A = R_3 * P_nt_R3_R4 * self.airgap.A / ( + nt * E_nt_R3_R4 + ) - 2 * R_4 * self.airgap.B / (nt * E_nt_R3_R4) + + self.rotor_magnet_surface.B = R_3 * P_nt_R3_R4 * self.airgap.C / ( + nt * E_nt_R3_R4 + ) - 2 * R_4 * self.airgap.D / (nt * E_nt_R3_R4) diff --git a/pyleecan/Methods/Simulation/Subdomain_Airgap/add_constants_numbers.py b/pyleecan/Methods/Simulation/Subdomain_Airgap/add_constants_numbers.py new file mode 100644 index 000000000..6bb3a4147 --- /dev/null +++ b/pyleecan/Methods/Simulation/Subdomain_Airgap/add_constants_numbers.py @@ -0,0 +1,15 @@ +def add_constants_numbers(self, csts_number): + """Return the number of integration constants in airgap subdomain + + Parameters + ---------- + self: Subdomain_Airgap + a Subdomain_Airgap object + + Returns + ---------- + nb_const: int + Number of integration constants in airgap subdomain + """ + + csts_number.extend([self.k.size, self.k.size, self.k.size, self.k.size]) diff --git a/pyleecan/Methods/Simulation/Subdomain_Airgap/comp_flux_density.py b/pyleecan/Methods/Simulation/Subdomain_Airgap/comp_flux_density.py new file mode 100644 index 000000000..9f738515e --- /dev/null +++ b/pyleecan/Methods/Simulation/Subdomain_Airgap/comp_flux_density.py @@ -0,0 +1,62 @@ +from numpy import cos, sin, matmul + +from ....Functions.SubdomainModel.E import E +from ....Functions.SubdomainModel.P import P + + +def comp_flux_density(self, r, angle): + """Method description + + Parameters + ---------- + self: Subdomain_Airgap + a Subdomain_Airgap object + r : float/array + Radius/Radii at which flux density is calculated + angle : array + Angular values at which flux density is calculated + + Returns + ---------- + Brg: ndarray + Radial airgap flux density + Bthetag: ndarray + Circumferential airgap flux density + """ + + R_3 = self.Rrbo + R_4 = self.Rsbo + + n = self.k[:, None] + P_n_r_R4, P_n_r_R3 = P(n, r, R_4), P(n, r, R_3) + E_n_r_R4, E_n_r_R3 = E(n, r, R_4), E(n, r, R_3) + E_n_R3_R4 = E(n, R_3, R_4) + + cosn = cos(n * angle[None, :]) + sinn = sin(n * angle[None, :]) + + # Fourier series of radial flux density + Brg_sin = -( + R_3 / r * self.A * P_n_r_R4 / E_n_R3_R4 + - R_4 / r * self.B * P_n_r_R3 / E_n_R3_R4 + ) + Brg_cos = ( + R_3 / r * self.C * P_n_r_R4 / E_n_R3_R4 + - R_4 / r * self.D * P_n_r_R3 / E_n_R3_R4 + ) + + # Fourier series of tangential flux density + Bthetag_cos = -( + R_3 / r * self.A * E_n_r_R4 / E_n_R3_R4 + - R_4 / r * self.B * E_n_r_R3 / E_n_R3_R4 + ) + Bthetag_sin = -( + R_3 / r * self.C * E_n_r_R4 / E_n_R3_R4 + - R_4 / r * self.D * E_n_r_R3 / E_n_R3_R4 + ) + + Bthetag = matmul(Bthetag_cos.T, cosn) + matmul(Bthetag_sin.T, sinn) + + Brg = matmul(Brg_cos.T, cosn) + matmul(Brg_sin.T, sinn) + + return Brg, Bthetag diff --git a/pyleecan/Methods/Simulation/Subdomain_Airgap/comp_torque.py b/pyleecan/Methods/Simulation/Subdomain_Airgap/comp_torque.py new file mode 100644 index 000000000..8ab794635 --- /dev/null +++ b/pyleecan/Methods/Simulation/Subdomain_Airgap/comp_torque.py @@ -0,0 +1,57 @@ +from numpy import pi, sum as np_sum + +from ....Functions.SubdomainModel.E import E +from ....Functions.SubdomainModel.P import P + + +def comp_torque(self): + """Method description + + Parameters + ---------- + self: Subdomain_Airgap + a Subdomain_Airgap object + + Returns + ---------- + var: type + var description + """ + + mu0 = 4 * pi * 1e-7 + + R_3 = self.Rrbo + R_4 = self.Rsbo + + L = self.parent.machine_polar_eq.rotor.L1 + + r = (R_3 + R_4) / 2 + + n = self.k[:, None] + P_n_r_R4, P_n_r_R3 = P(n, r, R_4), P(n, r, R_3) + E_n_r_R4, E_n_r_R3 = E(n, r, R_4), E(n, r, R_3) + E_n_R3_R4 = E(n, R_3, R_4) + + W_n = ( + -R_3 / r * self.A * P_n_r_R4 / E_n_R3_R4 + - R_4 / r * self.B * P_n_r_R3 / E_n_R3_R4 + ) + + X_n = ( + -R_3 / r * self.C * E_n_r_R4 / E_n_R3_R4 + - R_4 / r * self.D * E_n_r_R3 / E_n_R3_R4 + ) + + Y_n = ( + R_3 / r * self.C * P_n_r_R4 / E_n_R3_R4 + + R_4 / r * self.D * P_n_r_R3 / E_n_R3_R4 + ) + + Z_n = ( + -R_3 / r * self.A * E_n_r_R4 / E_n_R3_R4 + - R_4 / r * self.B * E_n_r_R3 / E_n_R3_R4 + ) + + Tem = pi * L * r**2 / mu0 * np_sum(W_n * X_n + Y_n * Z_n, axis=0) + + return Tem diff --git a/pyleecan/Methods/Simulation/Subdomain_MagnetSurface/add_constants_numbers.py b/pyleecan/Methods/Simulation/Subdomain_MagnetSurface/add_constants_numbers.py new file mode 100644 index 000000000..f9ef5f3e8 --- /dev/null +++ b/pyleecan/Methods/Simulation/Subdomain_MagnetSurface/add_constants_numbers.py @@ -0,0 +1,15 @@ +def add_constants_numbers(self, csts_number): + """Return the number of integration constants in magnet surface subdomain + + Parameters + ---------- + self: Subdomain_MagnetSurface + a Subdomain_MagnetSurface object + + Returns + ---------- + nb_const: int + Number of integration constants in magnet surface subdomain + """ + + pass diff --git a/pyleecan/Methods/Simulation/Subdomain_MagnetSurface/comp_flux_density.py b/pyleecan/Methods/Simulation/Subdomain_MagnetSurface/comp_flux_density.py new file mode 100644 index 000000000..7e91e84b5 --- /dev/null +++ b/pyleecan/Methods/Simulation/Subdomain_MagnetSurface/comp_flux_density.py @@ -0,0 +1,17 @@ +def comp_flux_density(self): + """Method description + + Parameters + ---------- + self: SdAirgap + a SdAirgap object + + Returns + ---------- + var: type + var description + """ + + raise Exception("Method comp_flux_density not implemented yet") + + return var diff --git a/pyleecan/Methods/Simulation/Subdomain_MagnetSurface/comp_interface_airgap.py b/pyleecan/Methods/Simulation/Subdomain_MagnetSurface/comp_interface_airgap.py new file mode 100644 index 000000000..7eb50fd95 --- /dev/null +++ b/pyleecan/Methods/Simulation/Subdomain_MagnetSurface/comp_interface_airgap.py @@ -0,0 +1,62 @@ +from numpy import diag, cos, sin + +from ....Functions.SubdomainModel.E import E +from ....Functions.SubdomainModel.P import P + + +def comp_interface_airgap(self, angle_rotor): + """Method description + + Parameters + ---------- + self: Subdomain_MagnetSurface + a Subdomain_MagnetSurface object + + """ + + sdm = self.parent + + if sdm is None: + raise Exception( + "Cannot compute interface with airgap if MagnetSurface is not in a SubdomainModel" + ) + + cp = sdm.csts_position + airgap = sdm.airgap + + mur = self.permeability_relative + + R_2 = self.Ryoke + + R_3 = airgap.Rrbo + R_4 = airgap.Rsbo + + n = self.k + + E_n_R2_R3, P_n_R2_R3 = E(n, R_2, R_3), P(n, R_2, R_3) + E_n_R3_R4, P_n_R3_R4 = E(n, R_3, R_4), P(n, R_3, R_4) + + # Fill topological matrix + # Mat = [M1 zeros(N, N) M2 zeros(N, N) ; ... + # zeros(N, N) M1 zeros(N, N) M2 ] ; + + M1 = diag(1 + 1 / mur * P_n_R3_R4 * E_n_R2_R3 / (P_n_R2_R3 * E_n_R3_R4)) + M2 = diag(-2 * R_4 / (R_3 * mur) * E_n_R2_R3 / (P_n_R2_R3 * E_n_R3_R4)) + + sdm.mat[cp[0], cp[0]] = M1 + sdm.mat[cp[0], cp[2]] = M2 + sdm.mat[cp[1], cp[1]] = M1 + sdm.mat[cp[1], cp[3]] = M2 + + # Fill source vector + # Vect = [V1 V2 zeros(ntt,nblS) ]' + + # Magnetization particular solution + _, _, dX_n_R3, dY_n_R3 = self.comp_magnet_solution(R_3) + + dZ_n_R3 = dX_n_R3 * self.Mrn + (dY_n_R3 - 1) * self.Mtn + + ndelta = n[:, None] * angle_rotor[None, :] + + sdm.vect[cp[0], :] = 1 / mur * dZ_n_R3[:, None] * sin(ndelta) + sdm.vect[cp[1], :] = -1 / mur * dZ_n_R3[:, None] * cos(ndelta) diff --git a/pyleecan/Methods/Simulation/Subdomain_MagnetSurface/comp_magnet_solution.py b/pyleecan/Methods/Simulation/Subdomain_MagnetSurface/comp_magnet_solution.py new file mode 100644 index 000000000..004d2bd58 --- /dev/null +++ b/pyleecan/Methods/Simulation/Subdomain_MagnetSurface/comp_magnet_solution.py @@ -0,0 +1,71 @@ +from numpy import log + +from ....Functions.SubdomainModel.E import E +from ....Functions.SubdomainModel.P import P + + +def comp_magnet_solution(self, r): + """Method description + + Parameters + ---------- + self: Subdomain_MagnetSurface + a Subdomain_MagnetSurface object + + Returns + ---------- + var: type + var description + """ + + Ry = self.Ryoke + Rag = self.Rbore + + n = self.k + + f_n_Rag = f(n, Rag) + df_n_Ry = df(n, Ry) + E_n_r_Rag = E(n, r, Rag) + P_n_Ry_Rag = P(n, Ry, Rag) + P_n_r_Rag = P(n, r, Rag) + + # Resolution in potential + X_n_r = (Ry * df_n_Ry * E_n_r_Rag + n * f_n_Rag * P(n, Ry, r)) / P_n_Ry_Rag - n * f( + n, r + ) + + Y_n_r = (X_n_r + Ry * E_n_r_Rag / P_n_Ry_Rag) / n + + dX_n_r = n * (Ry * df_n_Ry * P_n_r_Rag - n * f_n_Rag * E(n, Ry, r)) / ( + r * P_n_Ry_Rag + ) - n * df(n, r) + + dY_n_r = dX_n_r / n + Ry * P_n_r_Rag / (r * P_n_Ry_Rag) + + return X_n_r, Y_n_r, dX_n_r, dY_n_r + + +def f(n, r): + result = r / (n**2 - 1) + + is_n1 = n == 1 + + if isinstance(r, float): + result[is_n1] = -r * log(r) / 2 + else: + result[is_n1] = -r[is_n1] * log(r[is_n1]) / 2 + + return result + + +def df(n, r): + result = 1 / (n**2 - 1) + + is_n1 = n == 1 + + if isinstance(r, float): + result[is_n1] = -(log(r) + 1) / 2 + else: + result[is_n1] = -(log(r[is_n1]) + 1) / 2 + + return result diff --git a/pyleecan/Methods/Simulation/Subdomain_MagnetSurface/comp_magnet_source.py b/pyleecan/Methods/Simulation/Subdomain_MagnetSurface/comp_magnet_source.py new file mode 100644 index 000000000..48ec1c812 --- /dev/null +++ b/pyleecan/Methods/Simulation/Subdomain_MagnetSurface/comp_magnet_source.py @@ -0,0 +1,51 @@ +from numpy import pi, zeros, sinc, isinf, cos + + +def comp_magnet_source(self, rotor, sign_rot): + """Method description + + Parameters + ---------- + self: Subdomain_MagnetSurface + a Subdomain_MagnetSurface object + + + """ + + self.permeability_relative = rotor.magnet.mat_type.mag.mur_lin + Brm = rotor.magnet.mat_type.mag.get_Brm() + p = rotor.get_pole_pair_number() + taum = self.magnet_width / (pi / p) + type_magnetization = rotor.magnet.type_magnetization + n = self.k + + if type_magnetization == 0: + # radial magnetization Fourier series + self.Mrn = 2 * taum * Brm * sinc(n * taum / (2 * p)) + self.Mtn = zeros(n.size) + + elif type_magnetization == 1: + # parallel magnetization Fourier series + spos = sinc((n + 1) * taum / (2 * p)) + sneg = sinc((n - 1) * taum / (2 * p)) + self.Mrn = Brm * taum * (spos + sneg) + self.Mtn = Brm * taum * (spos - sneg) + + elif type_magnetization == 2: + # Hallbach magnetization + Mrn = ( + 4 + * taum + / pi + * Brm + * cos(n * pi * taum / (2 * p)) + / (1 - (n * taum / p) ** 2) + ) + Mrn[isinf(Mrn)] = p / taum * Brm / n(isinf(Mrn)) + Mtn = sign_rot * taum / p * n * Mrn + Mtn[isinf(Mrn)] = sign_rot * Mrn[isinf(Mrn)] + + # removing harmonics not multiple of n*p+1 + In = (n / p % 2) != 1 + self.Mrn[In] = 0 + self.Mtn[In] = 0 diff --git a/pyleecan/Methods/Simulation/Subdomain_Slot/add_constants_numbers.py b/pyleecan/Methods/Simulation/Subdomain_Slot/add_constants_numbers.py new file mode 100644 index 000000000..0b6c472aa --- /dev/null +++ b/pyleecan/Methods/Simulation/Subdomain_Slot/add_constants_numbers.py @@ -0,0 +1,13 @@ +def add_constants_numbers(self, csts_number): + """Method description + + Parameters + ---------- + self: Subdomain_Slot + a Subdomain_Slot object + csts_number: list + List of constants number + + """ + + csts_number.extend([self.number_per_a, self.number_per_a * self.k.size]) diff --git a/pyleecan/Methods/Simulation/Subdomain_Slot/comp_Phi_wind.py b/pyleecan/Methods/Simulation/Subdomain_Slot/comp_Phi_wind.py new file mode 100644 index 000000000..512f692be --- /dev/null +++ b/pyleecan/Methods/Simulation/Subdomain_Slot/comp_Phi_wind.py @@ -0,0 +1,62 @@ +from numpy import log, pi, einsum + + +def comp_Phi_wind(self): + """Method description + + Parameters + ---------- + self: Subdomain_Slot + a Subdomain_Slot object + + Returns + ---------- + var: type + var description + """ + + sdm = self.parent + + lam = sdm.machine_polar_eq.stator + per_a = sdm.per_a + # antiper_a = sdm.antiper_a + + mu0 = 4 * pi * 1e-7 + + R_5 = self.Rbore + R_6 = self.Ryoke + + As = self.A + Ji = self.Ji + + c = self.slot_width + + Lst1 = lam.L1 + + # Stator slot surface + Ss = abs((R_6**2 - R_5**2) / 2 * c) + + phi_i0 = Lst1 * ( + As + + c + * mu0 + / (16 * Ss) + * ( + R_5**4 + - 4 * R_5**2 * R_6**2 * log(R_5) + + 2 * R_5**2 * R_6**2 + + 4 * R_6**4 * log(R_6) + - 3 * R_6**4 + ) + * Ji + ) + + wind_mat = lam.winding.comp_connection_mat() + Nslot = self.number_per_a + Npcp1 = lam.winding.Npcp + + Phi_wind = einsum( + "mj, klmi -> ij", per_a * phi_i0 / Npcp1, wind_mat[:, :, :Nslot, :] + ) + + return Phi_wind diff --git a/pyleecan/Methods/Simulation/Subdomain_Slot/comp_current_solution.py b/pyleecan/Methods/Simulation/Subdomain_Slot/comp_current_solution.py new file mode 100644 index 000000000..65c8a6d8f --- /dev/null +++ b/pyleecan/Methods/Simulation/Subdomain_Slot/comp_current_solution.py @@ -0,0 +1,80 @@ +from numpy import pi, log + +from ....Functions.SubdomainModel.E import E +from ....Functions.SubdomainModel.P import P + + +def comp_current_solution(self, r): + """Method description + + Parameters + ---------- + self: Subdomain_Slot + a Subdomain_Slot object + r : float/ndarray + Radius at which solution is calculated + + Returns + ---------- + var: type + var description + """ + + mu0 = 4 * pi * 1e-7 + Ry = self.Ryoke + + # constant particular function + X_r = mu0 * (-(r**2) / 2 + Ry**2 * log(r)) / 2 + # derivative of the constant particular function + dX_r = mu0 * (-(r**2) + Ry**2) / (2 * r) + + if self.Jik is None: + return X_r, dX_r, None, None + else: + Rbo = self.Rbore + e_v = pi * self.k / self.slot_width + P_v_Rbo_Ry = P(e_v, Rbo, Ry) + f_v_Rbo = f(e_v, Rbo) + df_v_Ry = df(e_v, Ry) + + # harmonic particular function + Xv_r = mu0 * ( + Ry * df_v_Ry * E(e_v, Rbo, r) / (e_v * P_v_Rbo_Ry) + - f_v_Rbo * P(e_v, r, Ry) / P_v_Rbo_Ry + + f(e_v, r) + ) + + # derivative of the harmonic particular function + dXv_r = mu0 * ( + -Ry * df_v_Ry * P(e_v, Rbo, r) / (r * P_v_Rbo_Ry) + - e_v * f_v_Rbo * E(e_v, r, Ry) / (r * P_v_Rbo_Ry) + + df(e_v, r) + ) + + return X_r, dX_r, Xv_r, dXv_r + + +def f(v, r): + result = r**2 / (v**2 - 4) + + is_v2 = v == 2 + + if isinstance(r, float): + result[is_v2] = -(r**2) * (-log(r) + 1 / 4) / 4 + else: + result[is_v2] = -r[is_v2] ** 2 * (-log(r[is_v2]) + 1 / 4) / 4 + + return result + + +def df(v, r): + result = 2 * r / (v**2 - 4) + + is_v2 = v == 2 + + if isinstance(r, float): + result[is_v2] = r * (-log(r) + 1 / 4) / 2 - r / 4 + else: + result[is_v2] = r[is_v2] * (-log(r[is_v2]) + 1 / 4) / 2 - r[is_v2] / 4 + + return result diff --git a/pyleecan/Methods/Simulation/Subdomain_Slot/comp_current_source.py b/pyleecan/Methods/Simulation/Subdomain_Slot/comp_current_source.py new file mode 100644 index 000000000..078a70898 --- /dev/null +++ b/pyleecan/Methods/Simulation/Subdomain_Slot/comp_current_source.py @@ -0,0 +1,29 @@ +from numpy import kron, sin, pi, einsum, mean as np_mean + + +def comp_current_source(self, I_val, lam): + """Method description + + Parameters + ---------- + self: Subdomain_Slot + a Subdomain_Slot object + + """ + + wind_mat = lam.winding.comp_connection_mat() + slot_surf = lam.slot.comp_surface() + Nslot = self.number_per_a + + # If there are two layers in the stator slot + if wind_mat.shape[1] == 2: + # current density in left and right windings + Ji_lr = einsum("ij, klmi -> lmj", I_val / slot_surf, wind_mat[:, :, :Nslot, :]) + # mean value of current density in each slot + self.Ji = np_mean(Ji_lr, axis=0) + # Jik is the amplitude of the spatial fourier series of the current density within the slot + Jdiff = Ji_lr[0, ...] - Ji_lr[1, ...] + self.Jik = kron(Jdiff.T, sin(self.k * pi / 2) / (self.k * pi / 2)).T + else: + # both parts are equal is there is a single winding in the slots + self.Ji = einsum("ij, klmi -> mj", I_val / slot_surf, wind_mat[:, :, :Nslot, :]) diff --git a/pyleecan/Methods/Simulation/Subdomain_Slot/comp_flux_density.py b/pyleecan/Methods/Simulation/Subdomain_Slot/comp_flux_density.py new file mode 100644 index 000000000..7e91e84b5 --- /dev/null +++ b/pyleecan/Methods/Simulation/Subdomain_Slot/comp_flux_density.py @@ -0,0 +1,17 @@ +def comp_flux_density(self): + """Method description + + Parameters + ---------- + self: SdAirgap + a SdAirgap object + + Returns + ---------- + var: type + var description + """ + + raise Exception("Method comp_flux_density not implemented yet") + + return var diff --git a/pyleecan/Methods/Simulation/Subdomain_Slot/comp_interface_airgap.py b/pyleecan/Methods/Simulation/Subdomain_Slot/comp_interface_airgap.py new file mode 100644 index 000000000..535d1a7bc --- /dev/null +++ b/pyleecan/Methods/Simulation/Subdomain_Slot/comp_interface_airgap.py @@ -0,0 +1,109 @@ +from numpy import reshape, meshgrid, pi, eye, matmul, tile + +from ....Functions.SubdomainModel.E import E +from ....Functions.SubdomainModel.P import P +from ....Functions.SubdomainModel.I_cni import I_cni +from ....Functions.SubdomainModel.I_sni import I_sni +from ....Functions.SubdomainModel.I_ckni import I_ckni +from ....Functions.SubdomainModel.I_skni import I_skni + + +def comp_interface_airgap(self): + """Method description + + Parameters + ---------- + self: Subdomain_Slot + a Subdomain_Slot object + + Returns + ---------- + var: type + var description + """ + + sdm = self.parent + + if sdm is None: + raise Exception( + "Cannot compute interface with airgap if Slot is not in a SubdomainModel" + ) + + cp = sdm.csts_position + per_a = sdm.per_a + is_antiper_a = sdm.is_antiper_a + airgap = sdm.airgap + + v = self.k + theta_i = self.center_angle + n = airgap.k + d = self.slot_width + R_3 = airgap.Rrbo + R_4 = airgap.Rsbo + R_5 = self.Ryoke + + N, V, Zs0 = n.size, v.size, theta_i.size + + # Grid + ni, theta_in = meshgrid(n, theta_i) + vni, niv, theta_ivn = meshgrid(v, n, theta_i) + vni = reshape(vni, (N, V * Zs0)) + niv = reshape(niv, (N, V * Zs0)) + theta_ivn = reshape(theta_ivn, (N, V * Zs0)) + + # Interface integrals + I_cosni, I_cosni_a = I_cni(d, ni, theta_in, per_a, is_antiper_a) + I_sinni, I_sinni_a = I_sni(d, ni, theta_in, per_a, is_antiper_a) + I_cosvcosni, I_cosvcosni_a = I_ckni(d, niv, vni, theta_ivn, per_a, is_antiper_a) + I_cosvsinni, I_cosvsinni_a = I_skni(d, niv, vni, theta_ivn, per_a, is_antiper_a) + + E_ni_R3_R4, P_ni_R3_R4 = E(ni, R_3, R_4), P(ni, R_3, R_4) + E_niv_R3_R4, P_niv_R3_R4 = E(niv.T, R_3, R_4), P(niv.T, R_3, R_4) + E_vni_R4_R5, P_vni_R4_R5 = E(vni * pi / d, R_4, R_5), P(vni * pi / d, R_4, R_5) + + # Topological matrix + # [zeros(N, N) zeros(N, N) eye(N, N) zeros(N, N) zeros(N, Zs0) M16 ; ... + # zeros(N, N) zeros(N, N) zeros(N, N) eye(N, N) zeros(N, Zs0) M26 ; ... + # M31' M32' M33' M34' eye(Zs0, Zs0) zeros(Zs0, V*Zs0) ; ... + # M41' M42' M43' M44' zeros(V*Zs0, Zs0) eye(V*Zs0, V*Zs0) ] ; + sdm.mat[cp[2], cp[2]] = eye(N) + sdm.mat[cp[2], cp[5]] = ( + -per_a / (R_4 * d) * I_cosvcosni_a * vni * E_vni_R4_R5 / P_vni_R4_R5 + ) + + sdm.mat[cp[3], cp[3]] = eye(N) + sdm.mat[cp[3], cp[5]] = ( + -per_a / (R_4 * d) * I_cosvsinni_a * vni * E_vni_R4_R5 / P_vni_R4_R5 + ) + + sdm.mat[cp[4], cp[0]] = -2 * R_3 / d * I_cosni / (ni * E_ni_R3_R4) + sdm.mat[cp[4], cp[1]] = -2 * R_3 / d * I_sinni / (ni * E_ni_R3_R4) + sdm.mat[cp[4], cp[2]] = R_4 / d * I_cosni * P_ni_R3_R4 / (ni * E_ni_R3_R4) + sdm.mat[cp[4], cp[3]] = R_4 / d * I_sinni * P_ni_R3_R4 / (ni * E_ni_R3_R4) + sdm.mat[cp[4], cp[4]] = eye(Zs0) + + sdm.mat[cp[5], cp[0]] = -4 * R_3 / d * I_cosvcosni / (niv.T * E_niv_R3_R4) + sdm.mat[cp[5], cp[1]] = -4 * R_3 / d * I_cosvsinni / (niv.T * E_niv_R3_R4) + sdm.mat[cp[5], cp[2]] = ( + 2 * R_4 / d * I_cosvcosni * P_niv_R3_R4 / (niv.T * E_niv_R3_R4) + ) + sdm.mat[cp[5], cp[3]] = ( + 2 * R_4 / d * I_cosvsinni * P_niv_R3_R4 / (niv.T * E_niv_R3_R4) + ) + sdm.mat[cp[5], cp[5]] = eye(V * Zs0) + + # Source vector + # Vect = [zeros(ntt, nblR) V1 V2 V3 zeros(ntt, Zs0*V)] + Ji = self.Ji + _, dX_R5, _, dXv_R5 = self.comp_current_solution(r=R_4) + + sdm.vect[cp[2], :] = per_a / pi * dX_R5 * matmul(I_cosni_a, Ji) + sdm.vect[cp[3], :] = per_a / pi * dX_R5 * matmul(I_sinni_a, Ji) + + if self.Jik is not None: + # If it is a concentrated winding + # Harmonic component of stator slot current density + Jiv = self.Jik + Jiv_dXvi_R5 = Jiv * tile(dXv_R5, Zs0)[:, None] + sdm.vect[cp[2], :] += per_a / pi * matmul(I_cosvcosni_a, Jiv_dXvi_R5) + sdm.vect[cp[3], :] += per_a / pi * matmul(I_cosvsinni_a, Jiv_dXvi_R5) diff --git a/pyleecan/Methods/Simulation/Subdomain_SlotOpening/add_constants_numbers.py b/pyleecan/Methods/Simulation/Subdomain_SlotOpening/add_constants_numbers.py new file mode 100644 index 000000000..741af4133 --- /dev/null +++ b/pyleecan/Methods/Simulation/Subdomain_SlotOpening/add_constants_numbers.py @@ -0,0 +1,32 @@ +def add_constants_numbers(self, csts_number): + """Method description + + Parameters + ---------- + self: Subdomain_SlotOpening + a Subdomain_SlotOpening object + csts_number: list + List of constants number + + """ + raise Exception("Method not written yet") + pass + + # csts_number.extend([self.number_per_a, self.number_per_a * self.k.size]) + + +# def get_constants_number(self): +# """Method description + +# Parameters +# ---------- +# self: Subdomain_SlotOpening +# a Subdomain_SlotOpening object + +# Returns +# ---------- +# var: type +# var description +# """ + +# return self.number_per_a * (self.k.size + 2 + 2 * self.v.size) diff --git a/pyleecan/Methods/Simulation/Subdomain_SlotOpening/comp_flux_density.py b/pyleecan/Methods/Simulation/Subdomain_SlotOpening/comp_flux_density.py new file mode 100644 index 000000000..7e91e84b5 --- /dev/null +++ b/pyleecan/Methods/Simulation/Subdomain_SlotOpening/comp_flux_density.py @@ -0,0 +1,17 @@ +def comp_flux_density(self): + """Method description + + Parameters + ---------- + self: SdAirgap + a SdAirgap object + + Returns + ---------- + var: type + var description + """ + + raise Exception("Method comp_flux_density not implemented yet") + + return var