diff --git a/README.rst b/README.rst index 9a20aec..0c280a1 100644 --- a/README.rst +++ b/README.rst @@ -16,7 +16,8 @@ Usable features ~~~~~~~~~~~~~~~~~ * Human-readable database based on a .json-file - * The database currently contains 19 different materials as shown in the following table + * The database currently contains 19 different ferrite materials as shown in the following table + * The database includes data from manufacturer datasheets,the Princeton MagNet project and self measured data |material_overview| @@ -41,9 +42,6 @@ Usable features * Get the magnetic parameters from the database * Providing permeability and permittivity data for `FEMMT `__ -* Simulation features: - * All the material-data in the database can be used in the FEM-Magnetics-Toolbox for FEM-Simulations - * Interpolation of material data (both electric and magnetic parameters) * GUI features (included in `FEMMT `__): diff --git a/docs/source/figures/Material_Database_Overview.png b/docs/source/figures/Material_Database_Overview.png index 3b4da33..3951b7b 100644 Binary files a/docs/source/figures/Material_Database_Overview.png and b/docs/source/figures/Material_Database_Overview.png differ diff --git a/docs/source/figures/Material_Database_Overview.svg b/docs/source/figures/Material_Database_Overview.svg index b2945fb..4259d66 100644 --- a/docs/source/figures/Material_Database_Overview.svg +++ b/docs/source/figures/Material_Database_Overview.svg @@ -2,16 +2,16 @@ - - - + + d="M 51.36,214.94 H 544.78 V 784.32 H 51.36 Z" + clip-rule="evenodd" + id="path989" /> + + + d="m 395.95,762 h 87.144 v 22.32 H 395.95 Z" + clip-rule="evenodd" + id="path1155" /> + + + d="m 308.81,762 h 87.144 v 22.32 H 308.81 Z" + clip-rule="evenodd" + id="path1167" /> + + + d="m 51.36,739.18 h 65.664 v 45.144 H 51.36 Z" + clip-rule="evenodd" + id="path1179" /> + + + d="m 117.02,739.18 h 77.424 v 45.144 H 117.02 Z" + clip-rule="evenodd" + id="path1191" /> + + + d="m 194.45,739.18 h 114.36 v 45.144 H 194.45 Z" + clip-rule="evenodd" + id="path1203" /> + + + d="M 49.44,212.9 H 546.82 V 786.24 H 49.44 Z" + clip-rule="evenodd" + id="path1215" /> + + + d="M 51.36,214.94 H 514.78 V 784.32 H 51.36 Z" + clip-rule="evenodd" + id="path1325" /> + + + d="m 51.36,739.18 h 142.97 v 45.144 H 51.36 Z" + clip-rule="evenodd" + id="path1501" /> + + + d="m 194.33,739.18 h 78.96 v 45.144 h -78.96 z" + clip-rule="evenodd" + id="path1517" /> + + + d="m 273.29,739.18 h 145.1 v 45.144 h -145.1 z" + clip-rule="evenodd" + id="path1537" /> + + + d="m 418.39,739.18 h 95.904 v 45.144 H 418.39 Z" + clip-rule="evenodd" + id="path1553" /> + + + d="m 418.39,557.71 h 95.904 V 739.17 H 418.39 Z" + clip-rule="evenodd" + id="path1565" /> + + + d="m 418.39,350.33 h 95.904 V 531.79 H 418.39 Z" + clip-rule="evenodd" + id="path1577" /> + + + d="m 418.39,272.57 h 95.904 v 77.76 H 418.39 Z" + clip-rule="evenodd" + id="path1589" /> + + + d="m 51.36,609.58 h 142.97 v 129.6 H 51.36 Z" + clip-rule="evenodd" + id="path1601" /> + + - - - µ - - - - - ε - - - - - µ - - - - - ε - - - - - N95 - - - - - N87 - - - - - N49 - - - - - PC200 - - - - - N27 - - - - - N30 - - - - - T37 - - - - - DMR96A - - - - - 3F46 - - - - - 3C90 - - - - - 3C92 - - - - - 3C94 - - - - - 3C95 - - - - - 3F4 - - - - - 3E6 - - - - - 77 - - - - - 78 - - - - - 79 - - - - - ML95S - - - - - * former scientific worker of LEA department - ** own developt measurement test bench - - - - - LEA_MTB** - - - - - LEA_LK* - - - - - Material - - - - - Datasheet - - - - - FEM-Datasheet - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + d="m 51.36,557.71 h 142.97 v 51.864 H 51.36 Z" + clip-rule="evenodd" + id="path1613" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + MagNet + µ + ε + µ + ε + µ + N95 + N87 + N49 + PC200 + N27 + N30 + T37 + DMR96A + 3F46 + 3C90 + 3C92 + 3C94 + 3C95 + 3F4 + 3E6 + 77 + 78 + 79 + ML95S + * former scientific worker of the LEA department + ** own developt Material-Test-Bench by LEA department + - - + id="g1145" + transform="matrix(0.35277776,0,0,-0.35277778,220,297.01068)"> - + id="g1147" + clip-path="url(#clipPath1151)"> + LEA_LK* + id="g1157" + transform="matrix(0.35277776,0,0,-0.35277778,220,297.01068)"> - + id="g1159" + clip-path="url(#clipPath1163)"> + Material - + id="g1169" + transform="matrix(0.35277776,0,0,-0.35277778,220,297.01068)"> - + id="g1171" + clip-path="url(#clipPath1175)"> + Datasheet + id="g1181" + transform="matrix(0.35277776,0,0,-0.35277778,220,297.01068)"> - + id="g1183" + clip-path="url(#clipPath1187)"> + FEM-Datasheet - + id="g1193" + transform="matrix(0.35277776,0,0,-0.35277778,220,297.01068)"> - + id="g1195" + clip-path="url(#clipPath1199)"> + LEA_MTB** + id="g1205" + transform="matrix(0.35277776,0,0,-0.35277778,220,297.01068)"> + id="g1207" + clip-path="url(#clipPath1211)"> + d="m 52.32,712.3 h 63.264 v 1.92 H 52.32 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none" + id="path1213" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + id="g1315" + transform="matrix(0.35277776,0,0,-0.35277778,440.01566,297.01068)"> + id="g1317" + clip-path="url(#clipPath1321)"> µ - - - - + sodipodi:role="line" + id="tspan1323">3000 ε - - - - + sodipodi:role="line" + id="tspan1327">25 - 500 3000 - - - - + id="tspan1331">2200 25 - 500 - - - - + id="tspan1335">25 - 500 2200 - - - - + id="tspan1339">1500 25 - 500 - - - - + id="tspan1343">300 - 1000 1500 - - - - + id="tspan1347">800 300 - 1000 - - - - + id="tspan1351">700 - 4000 + 2000 + 25 - 150 + 4300 + 10 - 400 + 6500 + 10 - 300 800 - - - - + id="tspan1379">Power Conversion 700 - 4000 - - - - + id="tspan1383">3500 2000 - - - - + id="tspan1387">100 - 500 25 - 150 - - - - + id="tspan1391">DMGEC 4300 - - - - + id="tspan1395">750 10 - 400 - - - - + id="tspan1399">1000 - 3000 6500 - - - - + id="tspan1403">2300 10 - 300 - - - - + id="tspan1407">25 - 200 Power Conversion - - - - + id="tspan1411">1800 3500 - - - - + id="tspan1415">25 - 200 100 - 500 - - - - + id="tspan1419">2300 750 - - - - + id="tspan1423">25 - 300 1000 - 3000 - - - - + id="tspan1427">3000 2300 - - - - + id="tspan1431">100 - 500 25 - 200 - - - - + id="tspan1435">900 1800 - - - - + id="tspan1439">1000 - 2000 25 - 200 - - - - + id="tspan1443">EMI Suppression 2300 - - - - + id="tspan1447">10000 25 - 300 - - - - + id="tspan1451">< 15000 3000 - - - - + id="tspan1455">2000 100 - 500 - - - - + id="tspan1459">10 - 100 900 - - - - + id="tspan1463">2300 1000 - 2000 - - - - + id="tspan1467">25 - 500 EMI Suppression - - - - + id="tspan1471">1400 10000 - - - - + id="tspan1475">100 - 750 < 15000 - - - - + id="tspan1479">1100 2000 - - - - + id="tspan1483">500 - 1000 10 - 100 + id="tspan1487">Proterial + id="g1491" + transform="matrix(0.35277776,0,0,-0.35277778,440.01566,297.01068)"> + id="g1493" + clip-path="url(#clipPath1497)"> 2300 + id="tspan1499">Ferroxcube + id="g1503" + transform="matrix(0.35277776,0,0,-0.35277778,440.01566,297.01068)"> + id="g1505" + clip-path="url(#clipPath1509)"> 25 - 500 + id="tspan1511">Fair-Rite + id="g1515" + transform="matrix(0.35277776,0,0,-0.35277778,440.01566,297.01068)"> + id="g1517" + clip-path="url(#clipPath1521)"> 1400 + id="tspan1523">Power Transformer + id="g1527" + transform="matrix(0.35277776,0,0,-0.35277778,440.01566,297.01068)"> + id="g1529" + clip-path="url(#clipPath1533)"> 100 - 750 + id="tspan1535">Broadband Transformer + id="g1539" + transform="matrix(0.35277776,0,0,-0.35277778,440.01566,297.01068)"> + id="g1541" + clip-path="url(#clipPath1545)"> 1100 + id="tspan1547">Power Conversion + id="g1551" + transform="matrix(0.35277776,0,0,-0.35277778,440.01566,297.01068)"> + id="g1553" + clip-path="url(#clipPath1557)"> 500 - 1000 + id="tspan1559">Power Conversion + id="g1563" + transform="matrix(0.35277776,0,0,-0.35277778,440.01566,297.01068)"> - Usage + id="g1565" + clip-path="url(#clipPath1569)"> (manufacturer) + id="tspan1571">Epcos TDK + id="g1575" + transform="matrix(0.35277776,0,0,-0.35277778,440.01566,297.01068)"> - µ + id="g1577" + clip-path="url(#clipPath1581)"> i + sodipodi:role="line" + id="tspan1583">Usage at 25°C + id="tspan1587">(manufacturer) + id="g1591" + transform="matrix(0.35277776,0,0,-0.35277778,440.01566,297.01068)"> - operating frequency + id="g1593" + clip-path="url(#clipPath1597)"> in kHz (datasheet) - - - - + id="tspan1599">µ MagNet - - - - + id="tspan1603">i Power Transformer + id="tspan1607">at 25°C + id="g1611" + transform="matrix(0.35277776,0,0,-0.35277778,440.01566,297.01068)"> + id="g1613" + clip-path="url(#clipPath1617)"> Broadband Transformer - - - - + id="tspan1619">operating frequency Power Conversion + id="tspan1623">in kHz (datasheet) + id="g1627" + transform="matrix(0.35277776,0,0,-0.35277778,440.01566,297.01068)"> + id="g1629" + clip-path="url(#clipPath1633)"> Power Conversion + id="tspan1635">Manufacturer + id="g1639" + transform="matrix(0.35277776,0,0,-0.35277778,440.01566,297.01068)"> - - - - - - - - - - + id="g1641" + clip-path="url(#clipPath1645)"> + d="m 195.83,713.68 h 75.96" + style="fill:none;stroke:#000000;stroke-width:0.14;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1" + id="path1647" /> + id="path1649-5" /> - - - - + d="m 195.83,687.76 h 75.96" + style="fill:none;stroke:#000000;stroke-width:0.14;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1" + id="path1651" /> + id="path1653" /> + d="m 195.83,661.84 h 75.96" + style="fill:none;stroke:#000000;stroke-width:0.14;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1" + id="path1655" /> + id="path1657" /> - - + d="m 195.83,635.92 h 75.96" + style="fill:none;stroke:#000000;stroke-width:0.14;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1" + id="path1659" /> + id="path1661" /> + d="m 195.83,584.08 h 75.96" + style="fill:none;stroke:#000000;stroke-width:0.14;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1" + id="path1663" /> + id="path1665" /> - - + d="m 195.83,506.29 h 75.96" + style="fill:none;stroke:#000000;stroke-width:0.14;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1" + id="path1667" /> + id="path1669" /> + d="m 195.83,480.37 h 75.96" + style="fill:none;stroke:#000000;stroke-width:0.14;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1" + id="path1671" /> + id="path1673" /> - - + d="m 195.83,454.45 h 75.96" + style="fill:none;stroke:#000000;stroke-width:0.14;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1" + id="path1675" /> + id="path1677" /> + d="m 195.83,428.53 h 75.96" + style="fill:none;stroke:#000000;stroke-width:0.14;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1" + id="path1679" /> + id="path1681" /> + d="m 195.83,402.61 h 75.96" + style="fill:none;stroke:#000000;stroke-width:0.14;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1" + id="path1683" /> + id="path1685" /> + d="m 195.83,324.83 h 75.96" + style="fill:none;stroke:#000000;stroke-width:0.14;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1" + id="path1687" /> + id="path1689" /> + d="m 195.83,298.91 h 75.96" + style="fill:none;stroke:#000000;stroke-width:0.14;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1" + id="path1691" /> + id="path1693" /> + id="path1695" /> + id="path1697" /> + id="path1699" /> + id="path1701" /> - + id="path1703" /> + id="path1705" /> - + id="path1707" /> + d="m 274.79,713.68 h 142.1" + style="fill:none;stroke:#000000;stroke-width:0.14;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1" + id="path1709" /> - + id="path1711" /> + d="m 274.79,687.76 h 142.1" + style="fill:none;stroke:#000000;stroke-width:0.14;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1" + id="path1713" /> + id="path1715" /> + d="m 274.79,661.84 h 142.1" + style="fill:none;stroke:#000000;stroke-width:0.14;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1" + id="path1717" /> + id="path1719" /> + d="m 274.79,635.92 h 142.1" + style="fill:none;stroke:#000000;stroke-width:0.14;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1" + id="path1721" /> + id="path1723" /> - + id="path1725" /> + d="m 274.79,584.08 h 142.1" + style="fill:none;stroke:#000000;stroke-width:0.14;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1" + id="path1727" /> - + id="path1729" /> + id="path1731" /> - + id="path1733" /> + d="m 274.79,506.29 h 142.1" + style="fill:none;stroke:#000000;stroke-width:0.14;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1" + id="path1735" /> + id="path1737" /> + d="m 274.79,480.37 h 142.1" + style="fill:none;stroke:#000000;stroke-width:0.14;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1" + id="path1739" /> + id="path1741" /> + d="m 274.79,454.45 h 142.1" + style="fill:none;stroke:#000000;stroke-width:0.14;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1" + id="path1743" /> + id="path1745" /> + d="m 274.79,428.53 h 142.1" + style="fill:none;stroke:#000000;stroke-width:0.14;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1" + id="path1747" /> + id="path1749" /> - - - - - - - - DMGEC - - - - - Hitachi - - - - - Manufacturer - - - - - Epcos TDK - - - - - Ferroxcube - - - - - Fair-Rite - - - - + d="m 274.79,402.61 h 142.1" + style="fill:none;stroke:#000000;stroke-width:0.14;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1" + id="path1751" /> + id="path1753" /> + id="path1755" /> + id="path1757" /> + d="m 274.79,324.83 h 142.1" + style="fill:none;stroke:#000000;stroke-width:0.14;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1" + id="path1759" /> + id="path1761" /> + d="m 274.79,298.91 h 142.1" + style="fill:none;stroke:#000000;stroke-width:0.14;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1" + id="path1763" /> + id="path1765" /> + id="path1767" /> + id="path1769" /> diff --git a/docs/source/figures/Material_Database_Overview.xlsx b/docs/source/figures/Material_Database_Overview.xlsx index 80af5be..e45c992 100644 Binary files a/docs/source/figures/Material_Database_Overview.xlsx and b/docs/source/figures/Material_Database_Overview.xlsx differ diff --git a/materialdatabase/data/material_data_base.json b/materialdatabase/data/material_data_base.json index 2147ca8..24c22dd 100644 --- a/materialdatabase/data/material_data_base.json +++ b/materialdatabase/data/material_data_base.json @@ -31450,7 +31450,7 @@ } }, "ML95S": { - "Manufacturer": "Hitachi", + "Manufacturer": "Proterial", "manufacturer_datasheet": { "initial_permeability": 1100, "resistivity": 8, diff --git a/materialdatabase/enumerations.py b/materialdatabase/enumerations.py index 0856f56..5271715 100644 --- a/materialdatabase/enumerations.py +++ b/materialdatabase/enumerations.py @@ -42,6 +42,8 @@ class Manufacturer(str, Enum): Ferroxcube = "Ferroxcube" DMEGC = "DMEGC" SUMIDA = "Sumida" + FairRite = "Fair-Rite" + Proterial = "Proterial" class MeasurementDataType(str, Enum): @@ -151,7 +153,19 @@ class Material(str, Enum): TEST = "TEST" # FOR TESTING STUFF _3F46 = "3F46" + _3C90 = "3C90" + _3C92 = "3C92" + _3C94 = "3C94" _3C95 = "3C95" + _3E6 = "3E6" + _3F4 = "3F4" + _77 = "77" + _78 = "78" + _79 = "79" + ML95S = "ML95S" + T37 = "T37" + N27 = "N27" + N30 = "N30" N49 = "N49" N87 = "N87" N95 = "N95" diff --git a/materialdatabase/material_data_base_functions.py b/materialdatabase/material_data_base_functions.py index 6e6c91c..d041c2c 100644 --- a/materialdatabase/material_data_base_functions.py +++ b/materialdatabase/material_data_base_functions.py @@ -186,16 +186,17 @@ def interpolate_a_b_c(a, b, c, no_interpolation_values=20): # Load Permeability -------------------------------------------------------------------------------------------------------------------------------------------- -def updates_x_ticks_for_graph(x_data: list, y_data: list, x_new: list): +def updates_x_ticks_for_graph(x_data: list, y_data: list, x_new: list, kind: str = "linear"): """ Update the x-values of the given (x_data,y_data)-dataset and returns y_new based on x_new. :param x_data: x-data given :param y_data: y-data given :param x_new: new x-values + :param kind: kind of interpolation :return: y_new-data corresponding to the x_new-data """ - f_linear = interp1d(x_data, y_data, fill_value="extrapolate") + f_linear = interp1d(x_data, y_data, kind=kind, fill_value="extrapolate") return f_linear(x_new) @@ -608,13 +609,13 @@ def process_permeability_data(b_ref_raw, mu_r_raw, mu_phi_deg_raw, b_min: float fig, ax = plt.subplots(3) # Amplitude Plot - # ax[0].plot(b_ref_raw, mu_r_raw, label=f) + ax[0].plot(b_ref_raw*1000, mu_r_raw, label="raw") ax[0].plot(1000*b_ref, mu_r, "-x", label=f"{f=}, {T=}") ax[0].grid(True) ax[0].set_ylabel("rel. permeability") # Phase Plot - # ax[1].plot(b_ref_raw, mu_phi_deg_raw) + ax[1].plot(b_ref_raw*1000, mu_phi_deg_raw, label="raw") # if smooth_data: ax[1].plot(1000*b_ref, mu_phi_deg, "-x", label=f"{f=}, {T=}") ax[1].grid(True) @@ -1477,10 +1478,10 @@ def get_bh_integral(b, h, f): """ Calculate the hysteresis loss density. - :param b: magnetic flux density - :param h: magnetic field strength - :param f: frequency - :return: hysteresis loss density + :param b: magnetic flux density in T + :param h: magnetic field strength in A/m + :param f: frequency in Hz + :return: hysteresis loss density in W/m^3 """ return f * 0.5 * np.abs(np.sum(b * (np.roll(h, 1, axis=0) - np.roll(h, -1, axis=0)), axis=0)) # shoelace formula @@ -1589,7 +1590,7 @@ def calc_electric_field_strength_from_lecroy_voltage_data(voltage: np.array = No return electric_field_strength -def eps_phi_deg__from_eps_r_and_p_hyst(frequency, e_peak, eps_r, p_eddy): +def eps_phi_deg__from_eps_r_and_p_eddy(frequency, e_peak, eps_r, p_eddy): """ Calculate the angle of the permittivity. diff --git a/materialdatabase/scripts/write_MagNet_permeability_data_into_database.py b/materialdatabase/scripts/write_MagNet_permeability_data_into_database.py index 25a1d8b..882c77d 100644 --- a/materialdatabase/scripts/write_MagNet_permeability_data_into_database.py +++ b/materialdatabase/scripts/write_MagNet_permeability_data_into_database.py @@ -7,7 +7,7 @@ import pandas as pd import math import os -from scipy import constants +# from scipy import constants import materialdatabase as mdb material_db = mdb.MaterialDatabase() @@ -24,12 +24,13 @@ INSTRUCTIONS TO PUT DATA INTO DATABASE: 0. CHOOSE SIGNAL-SHAPE, TO LOAD OR PROCESS THE DATA AND TO WRITE THE DATA INTO THE DATABASE - 1. INPUT MATERIAL NAME AS ENUMERATION (Material.XXX.value) - 2. INPUT MANUFACTURER NAME AS ENUMERATION (Manufacturer.XXX) - 3. INPUT BASIC DATASHEET PARAMETERS FOR MATERIAL - 4. INPUT PATH TO FOLDER CONTAINING MagNet-DATA - 5. CHANGE ENUMERATION IN VARIABLE datadict TO DESIRED MATERIAl (MagNetFileNames._XXX.value) - 6. RUN SCRIPT + 1. SET MINIMUM NUMBER OF MEASUREMENT POINTS (START WITH LOW VALUE) + 2. INPUT MATERIAL NAME AS ENUMERATION (Material.XXX.value) + 3. INPUT MANUFACTURER NAME AS ENUMERATION (Manufacturer.XXX) + 4. INPUT BASIC DATASHEET PARAMETERS FOR MATERIAL + 5. INPUT PATH TO FOLDER CONTAINING MagNet-DATA + 6. CHANGE ENUMERATION IN VARIABLE datadict TO DESIRED MATERIAl (MagNetFileNames._XXX.value) + 7. RUN SCRIPT """ @@ -38,19 +39,21 @@ TRIANGLE = False # SET TRUE TO RUN TRIANGULAR DATA # TODO NOT IMPLEMENTED TRAPEZOID = False # SET TRUE TO RUN TRAPEZOIDAL DATA # TODO NOT IMPLEMENTED # PROCESS OF DATA -PROCESS_DATA = True # SET TRUE TO PROCESS DATA IF NOT DATA IS LOADED FROM GIVEN PATH +PROCESS_DATA = False # SET TRUE TO PROCESS DATA IF NOT DATA IS LOADED FROM GIVEN PATH # WRITE DATA INTO DATABASE -WRITE = False # SET TRUE TO WRITE DATA INTO DATABASE +WRITE = True # SET TRUE TO WRITE DATA INTO DATABASE -material = Material.N87.value # 1. -manufacturer = Manufacturer.Ferroxcube # 2. -initial_permeability = 2200 # 3. -resistivity = 10 # 3. -max_flux_density = 0.53 # 3. -volumetric_mass_density = 4850 # 3. +min_number_of_measurements = 7 # 1. -path = os.path.join(pt.my_MagNet_data_path, material) # 4. -data_dict = mat73.loadmat(os.path.join(path, MagNetFileNames._N87.value)) # 5. +material = Material._3F4.value # 2. +manufacturer = Manufacturer.Ferroxcube # 3. +initial_permeability = 900 # 4. +resistivity = 10 # 4. +max_flux_density = 0.41 # 4. +volumetric_mass_density = 4700 # 4. + +path = os.path.join(pt.my_MagNet_data_path, material) # 5. +data_dict = mat73.loadmat(os.path.join(path, MagNetFileNames._3F4.value)) # 6. cross_section = data_dict["Data"]["Effective_Area"] l_mag = data_dict["Data"]["Effective_Length"] @@ -92,46 +95,44 @@ permeability_amplitude = [calc_mu_r_from_b_and_h_array(b=b, h=h) for b, h in zip(mag_flux_density, mag_field_strength_without_offset)] # B_DC = np.array(H_DC_Bias) * mu - B_DC = np.array(H_DC_Bias) * constants.mu_0 * np.array(permeability_amplitude) - mag_flux_density_offset = [b + offset for b, offset in zip(mag_flux_density, B_DC)] + # B_DC = np.array(H_DC_Bias) * constants.mu_0 * np.array(permeability_amplitude) + # mag_flux_density_offset = [b + offset for b, offset in zip(mag_flux_density, B_DC)] - powerloss = [get_bh_integral(b=b, h=h, f=f) for b, h, f in zip(mag_flux_density_offset, mag_field_strength_offset, frequency)] + powerloss = [get_bh_integral(b=b, h=h, f=f) for b, h, f in zip(mag_flux_density, mag_field_strength_without_offset, frequency)] permeability_angle = [mu_phi_deg__from_mu_r_and_p_hyst(frequency=f, b_peak=abs(max(b, key=abs)), mu_r=mu, p_hyst=p) - for f, b, mu, p in zip(frequency, mag_flux_density_offset, permeability_amplitude, powerloss)] + for f, b, mu, p in zip(frequency, mag_flux_density, permeability_amplitude, powerloss)] np.savetxt(os.path.join(path, "sine/Voltage[V].csv"), voltage, delimiter=",") np.savetxt(os.path.join(path, "sine/Current[A].csv"), current, delimiter=",") np.savetxt(os.path.join(path, "sine/Frequency[Hz].csv"), frequency, delimiter=",") np.savetxt(os.path.join(path, "sine/Temperature[C].csv"), temperature, delimiter=",") - np.savetxt(os.path.join(path, "sine/H_waveform[Am-1].csv"), mag_field_strength_offset, delimiter=",") + np.savetxt(os.path.join(path, "sine/H_waveform[Am-1].csv"), mag_field_strength_without_offset, delimiter=",") np.savetxt(os.path.join(path, "sine/H_DC_Bias[Am-1].csv"), H_DC_Bias, delimiter=",") - np.savetxt(os.path.join(path, "sine/B_waveform[T].csv"), mag_flux_density_offset, delimiter=",") - np.savetxt(os.path.join(path, "sine/B_DC[T].csv"), B_DC, delimiter=",") + np.savetxt(os.path.join(path, "sine/B_waveform[T].csv"), mag_flux_density, delimiter=",") np.savetxt(os.path.join(path, "sine/Volumetric_losses[Wm-3].csv"), powerloss, delimiter=",") np.savetxt(os.path.join(path, "sine/Permeability_amplitude[_].csv"), permeability_amplitude, delimiter=",") np.savetxt(os.path.join(path, "sine/Permeability_angle[°].csv"), permeability_angle, delimiter=",") dict_sine = {"temperature": temperature, - "mag_flux_density": [abs(max(x, key=abs)) for x in mag_flux_density_offset], + "mag_flux_density": [abs(max(x, key=abs)) for x in mag_flux_density], "frequency": (np.array(frequency)/1000).astype(int)*1000, # round up to kHz "powerloss": powerloss, "H_DC_Bias": H_DC_Bias, - "B_DC": B_DC, "permeability_amplitude": permeability_amplitude, "permeability_angle": permeability_angle} df_sine = pd.DataFrame.from_dict(dict_sine) df_sine.to_csv(os.path.join(path, "sine/data_sine.csv"), index=False) - print("Sine data processed and saved!") + print("\n Sine data processed and saved!") else: df_sine = pd.read_csv(os.path.join(path, "sine/data_sine.csv"), encoding='latin1') unique_frequency = sorted(set(df_sine["frequency"])) - unique_H_DC_offset = sorted(set(df_sine["H_DC_Bias"])) + # unique_H_DC_offset = sorted(set(df_sine["H_DC_Bias"])) + unique_H_DC_offset = [0] # only the data for an H_DC of 0 A/m unique_temperature = sorted(set(df_sine["temperature"])) - min_number_of_measurements = 8 # Init the database entry if WRITE: @@ -146,9 +147,8 @@ for H_DC in unique_H_DC_offset: for frequency in unique_frequency: print("Number of measurement points: ", df_sine.query(filter_string).shape[0]) - if df_sine.query(filter_string).shape[0] > min_number_of_measurements: - b_ref = np.array(df_sine.query(filter_string).sort_values('mag_flux_density')["mag_flux_density"]) - \ - np.array(df_sine.query(filter_string).sort_values('mag_flux_density')["B_DC"]) + if df_sine.query(filter_string).shape[0] >= min_number_of_measurements: + b_ref = np.array(df_sine.query(filter_string).sort_values('mag_flux_density')["mag_flux_density"]) mu_r = np.array(df_sine.query(filter_string).sort_values('mag_flux_density')["permeability_amplitude"]) mu_phi_deg = np.array(df_sine.query(filter_string).sort_values('mag_flux_density')["permeability_angle"]) @@ -189,13 +189,13 @@ permeability_amplitude = [calc_mu_r_from_b_and_h_array(b=b, h=h) for b, h in zip(mag_flux_density, mag_field_strength_without_offset)] # B_DC = np.array(H_DC_Bias) * mu - B_DC = np.array(H_DC_Bias) * constants.mu_0 * np.array(permeability_amplitude) - mag_flux_density_offset = [b + offset for b, offset in zip(mag_flux_density, B_DC)] + # B_DC = np.array(H_DC_Bias) * constants.mu_0 * np.array(permeability_amplitude) + # mag_flux_density_offset = [b + offset for b, offset in zip(mag_flux_density, B_DC)] - powerloss = [get_bh_integral(b=b, h=h, f=f) for b, h, f in zip(mag_flux_density_offset, mag_field_strength_offset, frequency)] + powerloss = [get_bh_integral(b=b, h=h, f=f) for b, h, f in zip(mag_flux_density, mag_field_strength_offset, frequency)] permeability_angle = [mu_phi_deg__from_mu_r_and_p_hyst(frequency=f, b_peak=abs(max(b, key=abs)), mu_r=mu, p_hyst=p) - for f, b, mu, p in zip(frequency, mag_flux_density_offset, permeability_amplitude, powerloss)] + for f, b, mu, p in zip(frequency, mag_flux_density, permeability_amplitude, powerloss)] np.savetxt(os.path.join(path, "triangle/Voltage[V].csv"), voltage, delimiter=",") np.savetxt(os.path.join(path, "triangle/Current[A].csv"), current, delimiter=",") @@ -204,18 +204,16 @@ np.savetxt(os.path.join(path, "triangle/Duty_cycle[_].csv"), duty_cycle, delimiter=",") np.savetxt(os.path.join(path, "triangle/H_waveform[Am-1].csv"), mag_field_strength_offset, delimiter=",") np.savetxt(os.path.join(path, "triangle/H_DC_Bias[Am-1].csv"), H_DC_Bias, delimiter=",") - np.savetxt(os.path.join(path, "triangle/B_waveform[T].csv"), mag_flux_density_offset, delimiter=",") - np.savetxt(os.path.join(path, "triangle/B_DC[T].csv"), B_DC, delimiter=",") + np.savetxt(os.path.join(path, "triangle/B_waveform[T].csv"), mag_flux_density, delimiter=",") np.savetxt(os.path.join(path, "triangle/Volumetric_losses[Wm-3].csv"), powerloss, delimiter=",") np.savetxt(os.path.join(path, "triangle/Permeability_amplitude[_].csv"), permeability_amplitude, delimiter=",") np.savetxt(os.path.join(path, "triangle/Permeability_angle[°].csv"), permeability_angle, delimiter=",") dict_triangle = {"temperature": temperature, - "mag_flux_density": [abs(max(x, key=abs)) for x in mag_flux_density_offset], + "mag_flux_density": [abs(max(x, key=abs)) for x in mag_flux_density], "frequency": (np.array(frequency)/1000).astype(int)*1000, # round up to kHz "powerloss": powerloss, "H_DC_Bias": H_DC_Bias, - "B_DC": B_DC, "duty_cycle": duty_cycle, "permeability_amplitude": permeability_amplitude, "permeability_angle": permeability_angle}