diff --git a/examples/get_initial_magnetization_curve.py b/examples/get_initial_magnetization_curve.py new file mode 100644 index 0000000..7351c88 --- /dev/null +++ b/examples/get_initial_magnetization_curve.py @@ -0,0 +1,38 @@ + +"""Example to get the initialization magnetization curve from data, if data are available.""" + +import logging + + +# Debug +import matplotlib.pyplot as plt + +# own libraries +import materialdatabase as mdb + +# configure logging to show terminal output +logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.INFO) + +def get_datasheet_curve_example(): + """get_datasheet_curve() example.""" + # init a material database instance + mdb_data = mdb.Data() + material_name = mdb.Material.N49 + + # Initial magnetization curve at 25 degree + df_init_mag_curve_25 = mdb_data.get_initial_magnetization_curve(material_name, 500, 25) + # Initial magnetization curve at 100 degree + df_init_mag_curve_100 = mdb_data.get_initial_magnetization_curve(material_name, 500, 100) + # Interpolated initial magnetization curve at 40 degree + df_init_mag_curve_40 = mdb_data.get_initial_magnetization_curve(material_name, 500, 40) + + # plot all curves + plt.plot(df_init_mag_curve_25["h"], df_init_mag_curve_25["b"], 'o', label='at 25°') + plt.plot(df_init_mag_curve_100["h"], df_init_mag_curve_100["b"], 'o', label='at 100°') + plt.plot(df_init_mag_curve_40["h"], df_init_mag_curve_40["b"], 'o', label='at 40°') + plt.legend() + plt.show() + + +if __name__ == "__main__": + get_datasheet_curve_example() diff --git a/materialdatabase/data/datasheet_curves/N27/b_over_h_at_f_T.csv b/materialdatabase/data/datasheet_curves/N27/b_over_h_at_f_T.csv new file mode 100644 index 0000000..3ef501e --- /dev/null +++ b/materialdatabase/data/datasheet_curves/N27/b_over_h_at_f_T.csv @@ -0,0 +1,130 @@ +h,b,T,f,branch +24.62357,0.00163,25,10000,r +28.07308,27.5697,25,10000,r +30.32302,50.32847,25,10000,r +34.16636,75.54307,25,10000,r +37.71427,103.63202,25,10000,r +41.50128,137.41927,25,10000,r +44.78811,159.33284,25,10000,r +46.05173,178.67268,25,10000,r +51.25624,202.7603,25,10000,r +55.56312,227.13325,25,10000,r +59.4008,257.33529,25,10000,r +64.68206,280.265,25,10000,r +72.22543,302.17002,25,10000,r +78.15158,323.60648,25,10000,r +86.95433,351.14283,25,10000,r +105.43342,381.14778,25,10000,r +125.85143,401.29082,25,10000,r +155.33595,419.89593,25,10000,r +198.49711,435.95193,25,10000,r +259.52851,449.39698,25,10000,r +338.29226,458.32604,25,10000,r +415.96577,463.47597,25,10000,r +494.5475,466.83522,25,10000,r +573.29729,469.62801,25,10000,r +653.14661,471.89876,25,10000,r +730.79345,473.71254,25,10000,r +809.54132,475.65964,25,10000,r +888.12007,477.70938,25,10000,r +967.03716,479.60226,25,10000,r +1045.78465,481.38454,25,10000,r +1124.53224,483.21261,25,10000,r +1165.17633,484.22965,25,10000,r +1164.7966,485.03688,25,10000,f +1073.72944,482.9556,25,10000,f +994.98239,481.36756,25,10000,f +916.99689,479.56491,25,10000,f +837.48594,477.15611,25,10000,f +758.73874,475.50074,25,10000,f +679.99062,473.44049,25,10000,f +600.64965,471.31227,25,10000,f +522.49341,468.89648,25,10000,f +444.84345,465.71454,25,10000,f +364.98921,461.27518,25,10000,f +286.22954,454.13782,25,10000,f +205.97321,442.27595,25,10000,f +142.9429,426.64033,25,10000,f +103.47077,409.49654,25,10000,f +80.02269,392.42864,25,10000,f +65.50276,375.18968,25,10000,f +52.81576,355.98772,25,10000,f +44.49511,339.14918,25,10000,f +35.90834,321.48739,25,10000,f +28.15128,299.20474,25,10000,f +19.13279,276.43372,25,10000,f +14.04156,254.81845,25,10000,f +9.0158,234.79725,25,10000,f +6.12718,217.80476,25,10000,f +1.23536,198.96841,25,10000,f +-2.68959,174.67873,25,10000,f +-6.71946,149.47047,25,10000,f +-12.29252,123.82512,25,10000,f +-15.75731,101.41089,25,10000,f +-20.05022,71.82102,25,10000,f +-22.50802,51.34603,25,10000,f +-27.12003,26.27714,25,10000,f +-29.91166,0.0085,25,10000,f +23.23721,0.23248,100,10000,r +26.22426,28.77264,100,10000,r +28.11247,50.66508,100,10000,r +31.06676,76.63648,100,10000,r +35.02722,99.59415,100,10000,r +36.8783,116.84795,100,10000,r +40.3,142.61391,100,10000,r +44.39816,163.79446,100,10000,r +46.09104,178.44868,100,10000,r +50.48144,199.50302,100,10000,r +55.16573,224.66507,100,10000,r +60.15536,248.68407,100,10000,r +66.61717,272.71096,100,10000,r +75.23651,297.19414,100,10000,r +83.78207,318.01412,100,10000,r +92.64515,331.86216,100,10000,r +105.41529,349.19565,100,10000,r +138.5221,372.11516,100,10000,r +195.40276,387.95701,100,10000,r +282.10155,397.15943,100,10000,r +371.94527,402.33477,100,10000,r +462.11547,406.05496,100,10000,r +554.36516,408.68636,100,10000,r +644.90987,410.70671,100,10000,r +735.45459,412.15499,100,10000,r +827.77682,413.39737,100,10000,r +919.19216,414.31566,100,10000,r +1010.6075,415.20108,100,10000,r +1102.02284,416.09941,100,10000,r +1182.23195,416.95458,100,10000,r +1254.2346,417.81583,100,10000,r +1254.94027,418.82906,100,10000,f +1137.57324,417.72499,100,10000,f +1046.15791,416.48449,100,10000,f +954.74257,415.7157,100,10000,f +863.32723,414.65286,100,10000,f +769.82603,414.0882,100,10000,f +681.47601,412.41543,100,10000,f +589.08122,410.36652,100,10000,f +496.90409,408.07929,100,10000,f +406.25054,404.77963,100,10000,f +314.83521,400.14006,100,10000,f +223.41987,393.12907,100,10000,f +140.99022,379.51701,100,10000,f +97.77282,362.42786,100,10000,f +77.38474,345.91349,100,10000,f +60.92823,327.34977,100,10000,f +46.44978,304.65233,100,10000,f +39.63695,287.88787,100,10000,f +30.43193,268.41878,100,10000,f +22.51676,246.91073,100,10000,f +16.0502,224.59643,100,10000,f +9.33567,198.17873,100,10000,f +3.76913,174.81676,100,10000,f +-1.26046,150.80285,100,10000,f +-5.11848,126.84397,100,10000,f +-9.26602,99.6871,100,10000,f +-11.64713,82.15853,100,10000,f +-14.00608,65.18089,100,10000,f +-16.91196,50.49479,100,10000,f +-17.79053,33.80637,100,10000,f +-19.71954,18.28388,100,10000,f +-20.28799,0.08811,100,10000,f diff --git a/materialdatabase/data/datasheet_curves/N27/general_information.csv b/materialdatabase/data/datasheet_curves/N27/general_information.csv new file mode 100644 index 0000000..c9f9191 --- /dev/null +++ b/materialdatabase/data/datasheet_curves/N27/general_information.csv @@ -0,0 +1,2 @@ +application,material,initial permeability,curie temperature in C,density in kg/m^3,resistivity in Ohm m,saturation flux density in T at 25 C,saturation flux density in T at 100 C +power conversion,MnZn,2000,220,4800,3,0.5,0.41 diff --git a/materialdatabase/data/datasheet_curves/N30/b_over_h_at_f_T.csv b/materialdatabase/data/datasheet_curves/N30/b_over_h_at_f_T.csv new file mode 100644 index 0000000..0674470 --- /dev/null +++ b/materialdatabase/data/datasheet_curves/N30/b_over_h_at_f_T.csv @@ -0,0 +1,116 @@ +h,b,T,f,branch +13.32019,0.08727,25,10000,r +14.48854,17.65365,25,10000,r +15.697,32.11699,25,10000,r +17.44774,50.14838,25,10000,r +19.44333,69.75384,25,10000,r +21.11651,86.95154,25,10000,r +22.77094,102.03657,25,10000,r +25.05186,120.89447,25,10000,r +28.28086,146.7969,25,10000,r +31.62222,167.41753,25,10000,r +34.43134,186.19032,25,10000,r +36.65385,200.60629,25,10000,r +39.68711,217.01506,25,10000,r +42.77392,231.43964,25,10000,r +47.11748,249.66883,25,10000,r +53.56578,267.25297,25,10000,r +60.25712,281.01402,25,10000,r +67.98907,294.2162,25,10000,r +76.20567,305.52199,25,10000,r +87.44215,318.55732,25,10000,r +103.01073,331.22066,25,10000,r +122.94059,343.27258,25,10000,r +146.15598,353.08607,25,10000,r +172.47561,359.83477,25,10000,r +197.99461,363.52696,25,10000,r +224.44887,366.62713,25,10000,r +250.61899,369.15054,25,10000,r +276.64413,371.43794,25,10000,r +302.38513,373.30103,25,10000,r +328.8038,375.02187,25,10000,r +362.37965,376.81361,25,10000,r +362.02302,378.29875,25,10000,f +332.37013,376.51767,25,10000,f +302.38513,374.30691,25,10000,f +276.2875,372.43691,25,10000,f +250.18987,370.14973,25,10000,f +224.09224,367.60539,25,10000,f +197.99461,364.56046,25,10000,f +171.76235,360.58622,25,10000,f +145.79935,354.29441,25,10000,f +120.06419,344.6711,25,10000,f +96.50966,332.16416,25,10000,f +78.38047,318.38812,25,10000,f +64.96919,304.87018,25,10000,f +55.52755,292.35067,25,10000,f +45.76427,277.21351,25,10000,f +38.50909,263.27997,25,10000,f +32.69795,248.81046,25,10000,f +27.28428,232.47174,25,10000,f +23.28548,218.7881,25,10000,f +18.09699,198.41845,25,10000,f +13.69177,180.16495,25,10000,f +10.59913,165.61854,25,10000,f +7.9527,150.8566,25,10000,f +5.16796,134.53653,25,10000,f +2.65929,116.94405,25,10000,f +0.11092,98.46433,25,10000,f +-3.25597,75.53437,25,10000,f +-6.0239,54.48052,25,10000,f +-8.24916,38.66182,25,10000,f +-10.21676,22.64235,25,10000,f +-12.98252,0.13104,25,10000,f +362.02302,378.29875,25,10000,f +9.79895,0.06656,100,10000,r +10.83644,21.71613,100,10000,r +12.44007,43.91628,100,10000,r +13.81013,59.7573,100,10000,r +15.34124,73.44888,100,10000,r +16.99772,88.99304,100,10000,r +18.4232,102.89577,100,10000,r +20.55605,119.30787,100,10000,r +23.12024,134.36722,100,10000,r +26.8043,147.85265,100,10000,r +30.47475,161.2344,100,10000,r +36.18893,176.60652,100,10000,r +43.44968,190.13258,100,10000,r +55.7487,203.88238,100,10000,r +73.54959,214.83899,100,10000,r +99.30078,222.48181,100,10000,r +125.40349,225.5791,100,10000,r +151.50553,227.82572,100,10000,r +177.6073,229.71962,100,10000,r +203.70878,231.26081,100,10000,r +229.81009,232.58067,100,10000,r +255.91128,233.74839,100,10000,r +282.0124,234.82619,100,10000,r +308.11341,235.76568,100,10000,r +334.21432,236.57376,100,10000,r +368.78608,237.2052,100,10000,r +368.06962,238.67198,100,10000,f +337.75182,238.02506,100,10000,f +310.23046,237.21629,100,10000,f +281.28833,236.01769,100,10000,f +255.18724,234.97446,100,10000,f +229.08601,233.75834,100,10000,f +202.98478,232.53529,100,10000,f +176.88317,230.84196,100,10000,f +150.78149,229.0518,100,10000,f +124.67956,226.9435,100,10000,f +98.57675,223.72863,100,10000,f +72.4711,216.90726,100,10000,f +48.89914,205.22192,100,10000,f +32.93765,190.8696,100,10000,f +23.5023,177.87634,100,10000,f +16.96623,163.93545,100,10000,f +12.49193,150.23439,100,10000,f +9.7609,137.11673,100,10000,f +6.78265,121.51083,100,10000,f +4.21229,108.00104,100,10000,f +1.94843,92.76812,100,10000,f +-0.35501,78.19346,100,10000,f +-2.32066,60.54942,100,10000,f +-4.52265,39.48042,100,10000,f +-6.52569,21.42548,100,10000,f +-7.57171,0.01386,100,10000,f diff --git a/materialdatabase/data/datasheet_curves/N30/general_information.csv b/materialdatabase/data/datasheet_curves/N30/general_information.csv new file mode 100644 index 0000000..ec4508d --- /dev/null +++ b/materialdatabase/data/datasheet_curves/N30/general_information.csv @@ -0,0 +1,2 @@ +application,material,initial permeability,curie temperature in C,density in kg/m^3,resistivity in Ohm m,saturation flux density in T at 25 C,saturation flux density in T at 100 C +power conversion,MnZn,4300,130,4900,0.5,0.38,0.24 diff --git a/materialdatabase/data/datasheet_curves/N49/b_over_h_at_f_T.csv b/materialdatabase/data/datasheet_curves/N49/b_over_h_at_f_T.csv index 3c8e075..e27573d 100644 --- a/materialdatabase/data/datasheet_curves/N49/b_over_h_at_f_T.csv +++ b/materialdatabase/data/datasheet_curves/N49/b_over_h_at_f_T.csv @@ -1,186 +1,185 @@ -h,b,T,f --40.12904126064405,0.0026321169569344,25,10000 --38.08577722109442,0.0239125073979088,25,10000 --43.39826372392349,0.0127909844150719,25,10000 --33.36356699635758,0.0416058394160583,25,10000 --21.642366617099924,0.0571326409830059,25,10000 --14.622295166932986,0.100594144555139,25,10000 --22.148317712607422,0.0715159959229302,25,10000 --19.314991577765227,0.0838676267508383,25,10000 --9.949274632037032,0.123332182547511,25,10000 --18.606660044054703,0.1128846912606036,25,10000 --7.391410760304666,0.1395089432498191,25,10000 --3.84975309175195,0.1550116722561977,25,10000 --0.898371701291353,0.1687956204379561,25,10000 -2.643285967261249,0.1810292957190766,25,10000 -17.99046919765624,0.2416809144911335,25,10000 -11.851595905498243,0.2258187019135924,25,10000 -9.01826977065616,0.2145960741763661,25,10000 -7.955772470090324,0.1917463996843558,25,10000 -36.03605827075785,0.2994831445105168,25,10000 -27.43488964712992,0.262098457946998,25,10000 -29.20571848140628,0.2741467745117379,25,10000 -34.51820498423535,0.2840887420266981,25,10000 -38.94527706992619,0.0068510800946931,25,10000 -43.96262543370904,0.038319934898402,25,10000 -41.60152032134067,0.026271618333662,25,10000 -41.60152032134067,0.0170879364766225,25,10000 -49.27511193653811,0.3163580094693233,25,10000 -47.672933467430994,0.0557605050305779,25,10000 -61.33361304613413,0.1003729779049121,25,10000 -52.732444422506205,0.0739593608206746,25,10000 -55.0598194618409,0.3282378181100808,25,10000 -54.58759843936707,0.0855864075754586,25,10000 -62.85146633265674,0.341583645689485,25,10000 -62.26119005456462,0.1190352304859604,25,10000 -65.68479246749882,0.1340155849279936,25,10000 -69.93478166976206,0.3531095876898796,25,10000 -69.22645013605154,0.1469569934898401,25,10000 -74.06671561640678,0.1613307194055367,25,10000 -77.01809700686738,0.174963010455711,25,10000 -82.33058350969634,0.3649514820477411,25,10000 -78.78892584114374,0.1856801144209903,25,10000 -89.41389884680177,0.2176123660156507,25,10000 -84.1014123439727,0.1978126849477214,25,10000 -93.30972228220968,0.3762625764450581,25,10000 -92.95555651535436,0.2326938252120733,25,10000 -98.26804301818343,0.2488705859143815,25,10000 -113.85133675981524,0.3001812487670151,25,10000 -123.07692307692298,0.3977557621490102,25,10000 -105.35135835528877,0.269470679621227,25,10000 -108.89301602384148,0.3865752613927796,25,10000 -110.66384485811771,0.2845100118366541,25,10000 -123.64992297614424,0.3186328664430853,25,10000 -128.37213320088108,0.3307654369698165,25,10000 -137.22627737226276,0.343993309002433,25,10000 -144.29231633049733,0.4094643000664899,25,10000 -147.8512503779208,0.3574739429210232,25,10000 -158.47622338357883,0.3697750213717366,25,10000 -170.87202522351322,0.4207486683764055,25,10000 -169.10119638923686,0.381570576050503,25,10000 -180.2934105011592,0.392815581809651,25,10000 -205.60751389585675,0.4330709288738486,25,10000 -198.30226353787052,0.4044163618981137,25,10000 -225.05938755236912,0.4394530479384493,25,10000 -232.34508332767743,0.4209653214215257,25,10000 -260.9629421673218,0.4451500542513317,25,10000 -257.6426381030536,0.4299492010258433,25,10000 -298.1946184079817,0.4522294302905618,25,10000 -300.14253012568565,0.4412223811402643,25,10000 -333.3455707683672,0.4478165624892357,25,10000 -374.5173411652918,0.4615766562846855,25,10000 -412.29502296318697,0.4610609012296967,25,10000 -452.4338098734506,0.4656024139600782,25,10000 -491.3920442275301,0.4681759895263545,25,10000 -530.3502785816095,0.4703819114403055,25,10000 -569.3085129356887,0.4723120931150127,25,10000 -607.3813328726301,0.4734073946208982,25,10000 -647.2249816438475,0.4757128893990207,25,10000 -686.1832159979269,0.4770915905952402,25,10000 -725.1414503520064,0.4783324216718376,25,10000 -764.0996847060858,0.4794353826288132,25,10000 -802.7627809211192,0.4804004734661669,25,10000 -842.0161534142444,0.4815034344231423,25,10000 -880.9743877683238,0.482468525260496,25,10000 -919.9326221224032,0.4834336160978496,25,10000 -958.8908564764828,0.4843527502286626,25,10000 -997.849090830562,0.4849923143946866,25,10000 -1036.8073251846415,0.485731451424882,25,10000 -1075.7655595387207,0.4864667587295324,25,10000 -1114.7237938928,0.4872020660341828,25,10000 -1153.6820282468796,0.4876156763930486,25,10000 -1183.431952662722,0.4867700729927007,25,10000 --30.41290150953398,0.0222861917406831,100,10000 --32.61882126717552,0.0117743338522113,100,10000 --23.787693357720343,0.0369947479953431,100,10000 --21.18733355442725,0.0467691668737818,100,10000 --16.775466653560102,0.0588137247046973,100,10000 --15.959797983839678,0.0704208471228433,100,10000 --7.823548600375943,0.0984725242651772,100,10000 --14.035703272701824,0.0818318778042304,100,10000 --4.572477741210946,0.1148280835088362,100,10000 --3.7631088512687834,0.1254713396209138,100,10000 --0.738189241450641,0.1355233037267649,100,10000 --6.95752112767093,0.0894869975276989,100,10000 -14.108103555579248,0.1843624876176841,100,10000 -8.871456054264911,0.1720567026829045,100,10000 -6.3465490124261805,0.1630465387785002,100,10000 -3.822562126214791,0.1541771586851021,100,10000 -2.28452199486145,0.1452373866862009,100,10000 -28.71636943395612,0.0010891859719804,100,10000 -35.45636240486493,0.2401608712572109,100,10000 -32.41961879523353,0.2282998351799285,100,10000 -30.88433913076267,0.2197824146140463,100,10000 -29.34813931066429,0.2111242102371578,100,10000 -34.692403195139434,0.0226616152366999,100,10000 -32.47022735474559,0.0096625766871165,100,10000 -37.9359517820497,0.0374170994283622,100,10000 -65.373585268738,0.300931552251887,100,10000 -42.125420354022026,0.2543917681530995,100,10000 -40.98232416306877,0.0507513375279605,100,10000 -44.02672478202891,0.0637838960325454,100,10000 -47.48204061406637,0.2690466924797572,100,10000 -47.073885867871525,0.0772388059701493,100,10000 -54.967342330211125,0.2823960145591063,100,10000 -78.36923873815817,0.1996015967824868,100,10000 -56.009035180167984,0.1147811555718341,100,10000 -52.3262656404014,0.1046916491163812,100,10000 -59.25030528647676,0.1291880322314806,100,10000 -62.56897800783168,0.1437591566706346,100,10000 -63.91332537959784,0.2928492125263254,100,10000 -65.49139228074716,0.1569928349052284,100,10000 -68.52284499552047,0.1680443640692244,100,10000 -71.55199732122503,0.1787439337057046,100,10000 -73.97700175207888,0.3126092259997122,100,10000 -73.58958994274383,0.1886551140005494,100,10000 -85.9892391165788,0.3250652412782713,100,10000 -83.64928335586603,0.2185857522204926,100,10000 -79.64384590939198,0.209434804505082,100,10000 -86.13449225491854,0.2323021178071082,100,10000 -91.72537427891211,0.2468657002563868,100,10000 -96.5244952481496,0.334330156840687,100,10000 -98.39876462748214,0.2617594542624302,100,10000 -104.49218855200718,0.2759551552055673,100,10000 -116.14042841648052,0.2999149955742759,100,10000 -111.5999306965714,0.3447280468821537,100,10000 -109.74839354293124,0.2878232304733999,100,10000 -125.98932439929548,0.3148416550028124,100,10000 -132.37911511550874,0.3546181096053475,100,10000 -135.35834899842175,0.3253401049092836,100,10000 -148.52853649471876,0.3352955315447303,100,10000 -162.60991975414277,0.3652544850077128,100,10000 -161.9168008747314,0.3462766688032231,100,10000 -195.77198390411505,0.372637175005521,100,10000 -186.6427628188901,0.3563427112901749,100,10000 -217.227836260294,0.3761963711378472,100,10000 -225.69036155138485,0.3692756241103462,100,10000 -247.55037473337927,0.3747472115076458,100,10000 -279.0419049890145,0.3823685185339338,100,10000 -311.61516325070625,0.3857089344132656,100,10000 -344.1811439178897,0.38793587833282,100,10000 -376.7421055543776,0.3893949105559764,100,10000 -410.63715817340585,0.3912275318194305,100,10000 -441.8607664574016,0.3918138323996304,100,10000 -472.1151674763039,0.3925163293959649,100,10000 -506.9806343178072,0.3944174187226563,100,10000 -539.5364813230152,0.3950939123599595,100,10000 -572.0921371270538,0.3957411522183521,100,10000 -604.1557546468821,0.3965666572919801,100,10000 -637.2011065208064,0.396677273143485,100,10000 -669.7551251648324,0.3970740275199574,100,10000 -702.3085582552774,0.3973811921985166,100,10000 -734.8627442003265,0.3978035436315356,100,10000 -767.4141696784932,0.3978035436315356,100,10000 -799.9651350788461,0.3977331517260324,100,10000 -832.522039665522,0.3985714553279337,100,10000 -865.0739670467583,0.3986482464975735,100,10000 -897.6279020402728,0.3990322023457725,100,10000 -930.182087985322,0.3994545537787914,100,10000 -962.7337644150234,0.3994929493636114,100,10000 -995.5294912122891,0.3991409898360956,100,10000 -1027.8393758382394,0.3999153007966304,100,10000 -1060.3928089286844,0.4002224654751896,100,10000 -1092.9449872614557,0.4003376522296493,100,10000 -1125.4964127396222,0.4003376522296493,100,10000 -1158.047838217789,0.4003376522296493,100,10000 -1178.762381703895,0.4003376522296493,100,10000 +h,b,T,f,branch +38.9452770699262,0.0068510800946931,25,10000,r +41.6015203213407,0.0170879364766225,25,10000,r +43.962625433709,0.038319934898402,25,10000,r +47.672933467431,0.0557605050305779,25,10000,r +52.7324444225062,0.0739593608206746,25,10000,r +54.5875984393671,0.0855864075754586,25,10000,r +61.3336130461341,0.100372977904912,25,10000,r +62.2611900545646,0.11903523048596,25,10000,r +65.6847924674988,0.134015584927994,25,10000,r +69.2264501360515,0.14695699348984,25,10000,r +74.0667156164068,0.161330719405537,25,10000,r +77.0180970068674,0.174963010455711,25,10000,r +78.7889258411437,0.18568011442099,25,10000,r +84.1014123439727,0.197812684947721,25,10000,r +89.4138988468018,0.217612366015651,25,10000,r +92.9555565153544,0.232693825212073,25,10000,r +98.2680430181834,0.248870585914382,25,10000,r +105.351358355289,0.269470679621227,25,10000,r +110.663844858118,0.284510011836654,25,10000,r +113.851336759815,0.300181248767015,25,10000,r +123.649922976144,0.318632866443085,25,10000,r +128.372133200881,0.330765436969817,25,10000,r +137.226277372263,0.343993309002433,25,10000,r +147.851250377921,0.357473942921023,25,10000,r +158.476223383579,0.369775021371737,25,10000,r +169.101196389237,0.381570576050503,25,10000,r +180.293410501159,0.392815581809651,25,10000,r +198.302263537871,0.404416361898114,25,10000,r +232.345083327677,0.420965321421526,25,10000,r +257.642638103054,0.429949201025843,25,10000,r +300.142530125686,0.441222381140264,25,10000,r +333.345570768367,0.447816562489236,25,10000,r +412.295022963187,0.461060901229697,25,10000,r +569.308512935689,0.472312093115013,25,10000,r +725.141450352006,0.478332421671838,25,10000,r +802.762780921119,0.480400473466167,25,10000,r +880.974387768324,0.482468525260496,25,10000,r +958.890856476483,0.484352750228663,25,10000,r +1075.76555953872,0.486466758729532,25,10000,r +1183.43195266272,0.486770072992701,25,10000,r +-43.3982637239235,0.0127909844150719,25,10000,f +-40.1290412606441,0.0026321169569344,25,10000,f +-38.0857772210944,0.0239125073979088,25,10000,f +-33.3635669963576,0.0416058394160583,25,10000,f +-22.1483177126074,0.0715159959229302,25,10000,f +-21.6423666170999,0.0571326409830059,25,10000,f +-19.3149915777652,0.0838676267508383,25,10000,f +-18.6066600440547,0.112884691260604,25,10000,f +-14.622295166933,0.100594144555139,25,10000,f +-9.94927463203703,0.123332182547511,25,10000,f +-7.39141076030467,0.139508943249819,25,10000,f +-3.84975309175195,0.155011672256198,25,10000,f +-0.898371701291353,0.168795620437956,25,10000,f +2.64328596726125,0.181029295719077,25,10000,f +7.95577247009032,0.191746399684356,25,10000,f +9.01826977065616,0.214596074176366,25,10000,f +11.8515959054982,0.225818701913592,25,10000,f +17.9904691976562,0.241680914491134,25,10000,f +27.4348896471299,0.262098457946998,25,10000,f +29.2057184814063,0.274146774511738,25,10000,f +34.5182049842354,0.284088742026698,25,10000,f +36.0360582707579,0.299483144510517,25,10000,f +49.2751119365381,0.316358009469323,25,10000,f +55.0598194618409,0.328237818110081,25,10000,f +62.8514663326567,0.341583645689485,25,10000,f +69.9347816697621,0.35310958768988,25,10000,f +82.3305835096963,0.364951482047741,25,10000,f +93.3097222822097,0.376262576445058,25,10000,f +108.893016023841,0.38657526139278,25,10000,f +123.076923076923,0.39775576214901,25,10000,f +144.292316330497,0.40946430006649,25,10000,f +170.872025223513,0.420748668376406,25,10000,f +205.607513895857,0.433070928873849,25,10000,f +225.059387552369,0.439453047938449,25,10000,f +260.962942167322,0.445150054251332,25,10000,f +298.194618407982,0.452229430290562,25,10000,f +374.517341165292,0.461576656284686,25,10000,f +452.433809873451,0.465602413960078,25,10000,f +491.39204422753,0.468175989526355,25,10000,f +530.35027858161,0.470381911440306,25,10000,f +607.38133287263,0.473407394620898,25,10000,f +647.224981643848,0.475712889399021,25,10000,f +686.183215997927,0.47709159059524,25,10000,f +764.099684706086,0.479435382628813,25,10000,f +842.016153414244,0.481503434423142,25,10000,f +919.932622122403,0.48343361609785,25,10000,f +997.849090830562,0.484992314394687,25,10000,f +1036.80732518464,0.485731451424882,25,10000,f +1114.7237938928,0.487202066034183,25,10000,f +1153.68202824688,0.487615676393049,25,10000,f +28.7163694339561,0.0010891859719804,100,10000,r +32.4702273547456,0.0096625766871165,100,10000,r +34.6924031951394,0.0226616152366999,100,10000,r +37.9359517820497,0.0374170994283622,100,10000,r +40.9823241630688,0.0507513375279605,100,10000,r +44.0267247820289,0.0637838960325454,100,10000,r +47.0738858678715,0.0772388059701493,100,10000,r +52.3262656404014,0.104691649116381,100,10000,r +56.009035180168,0.114781155571834,100,10000,r +59.2503052864768,0.129188032231481,100,10000,r +62.5689780078317,0.143759156670635,100,10000,r +65.4913922807472,0.156992834905228,100,10000,r +68.5228449955205,0.168044364069224,100,10000,r +71.551997321225,0.178743933705705,100,10000,r +73.5895899427438,0.188655114000549,100,10000,r +78.3692387381582,0.199601596782487,100,10000,r +79.643845909392,0.209434804505082,100,10000,r +83.649283355866,0.218585752220493,100,10000,r +86.1344922549185,0.232302117807108,100,10000,r +91.7253742789121,0.246865700256387,100,10000,r +98.3987646274821,0.26175945426243,100,10000,r +104.492188552007,0.275955155205567,100,10000,r +109.748393542931,0.2878232304734,100,10000,r +116.140428416481,0.299914995574276,100,10000,r +125.989324399295,0.314841655002812,100,10000,r +135.358348998422,0.325340104909284,100,10000,r +148.528536494719,0.33529553154473,100,10000,r +161.916800874731,0.346276668803223,100,10000,r +186.64276281889,0.356342711290175,100,10000,r +225.690361551385,0.369275624110346,100,10000,r +247.550374733379,0.374747211507646,100,10000,r +311.615163250706,0.385708934413266,100,10000,r +572.092137127054,0.395741152218352,100,10000,r +637.201106520806,0.396677273143485,100,10000,r +799.965135078846,0.397733151726032,100,10000,r +865.073967046758,0.398648246497574,100,10000,r +930.182087985322,0.399454553778791,100,10000,r +995.529491212289,0.399140989836096,100,10000,r +1060.39280892868,0.40022246547519,100,10000,r +1125.49641273962,0.400337652229649,100,10000,r +1178.7623817039,0.400337652229649,100,10000,r +-32.6188212671755,0.0117743338522113,100,10000,f +-30.412901509534,0.0222861917406831,100,10000,f +-23.7876933577203,0.0369947479953431,100,10000,f +-21.1873335544273,0.0467691668737818,100,10000,f +-16.7754666535601,0.0588137247046973,100,10000,f +-15.9597979838397,0.0704208471228433,100,10000,f +-14.0357032727018,0.0818318778042304,100,10000,f +-7.82354860037594,0.0984725242651772,100,10000,f +-6.95752112767093,0.0894869975276989,100,10000,f +-4.57247774121095,0.114828083508836,100,10000,f +-3.76310885126878,0.125471339620914,100,10000,f +-0.738189241450641,0.135523303726765,100,10000,f +2.28452199486145,0.145237386686201,100,10000,f +3.82256212621479,0.154177158685102,100,10000,f +6.34654901242618,0.1630465387785,100,10000,f +8.87145605426491,0.172056702682905,100,10000,f +14.1081035555792,0.184362487617684,100,10000,f +29.3481393106643,0.211124210237158,100,10000,f +30.8843391307627,0.219782414614046,100,10000,f +32.4196187952335,0.228299835179929,100,10000,f +35.4563624048649,0.240160871257211,100,10000,f +42.125420354022,0.2543917681531,100,10000,f +47.4820406140664,0.269046692479757,100,10000,f +54.9673423302111,0.282396014559106,100,10000,f +63.9133253795978,0.292849212526325,100,10000,f +65.373585268738,0.300931552251887,100,10000,f +73.9770017520789,0.312609225999712,100,10000,f +85.9892391165788,0.325065241278271,100,10000,f +96.5244952481496,0.334330156840687,100,10000,f +111.599930696571,0.344728046882154,100,10000,f +132.379115115509,0.354618109605348,100,10000,f +162.609919754143,0.365254485007713,100,10000,f +195.771983904115,0.372637175005521,100,10000,f +217.227836260294,0.376196371137847,100,10000,f +279.041904989015,0.382368518533934,100,10000,f +344.18114391789,0.38793587833282,100,10000,f +376.742105554378,0.389394910555976,100,10000,f +410.637158173406,0.391227531819431,100,10000,f +441.860766457402,0.39181383239963,100,10000,f +472.115167476304,0.392516329395965,100,10000,f +506.980634317807,0.394417418722656,100,10000,f +539.536481323015,0.39509391235996,100,10000,f +604.155754646882,0.39656665729198,100,10000,f +669.755125164832,0.397074027519957,100,10000,f +702.308558255277,0.397381192198517,100,10000,f +734.862744200327,0.397803543631536,100,10000,f +767.414169678493,0.397803543631536,100,10000,f +832.522039665522,0.398571455327934,100,10000,f +897.627902040273,0.399032202345773,100,10000,f +962.733764415023,0.399492949363611,100,10000,f +1027.83937583824,0.39991530079663,100,10000,f +1092.94498726146,0.400337652229649,100,10000,f +1158.04783821779,0.400337652229649,100,10000,f diff --git a/materialdatabase/data/datasheet_curves/T37/b_over_h_at_f_T.csv b/materialdatabase/data/datasheet_curves/T37/b_over_h_at_f_T.csv new file mode 100644 index 0000000..14ce802 --- /dev/null +++ b/materialdatabase/data/datasheet_curves/T37/b_over_h_at_f_T.csv @@ -0,0 +1,115 @@ +h,b,T,f,branch +13.32019,0.08727,25,10000,r +14.48854,17.65365,25,10000,r +15.697,32.11699,25,10000,r +17.44774,50.14838,25,10000,r +19.44333,69.75384,25,10000,r +21.11651,86.95154,25,10000,r +22.77094,102.03657,25,10000,r +25.05186,120.89447,25,10000,r +28.28086,146.7969,25,10000,r +31.62222,167.41753,25,10000,r +34.43134,186.19032,25,10000,r +36.65385,200.60629,25,10000,r +39.68711,217.01506,25,10000,r +42.77392,231.43964,25,10000,r +47.11748,249.66883,25,10000,r +53.56578,267.25297,25,10000,r +60.25712,281.01402,25,10000,r +67.98907,294.2162,25,10000,r +76.20567,305.52199,25,10000,r +87.44215,318.55732,25,10000,r +103.01073,331.22066,25,10000,r +122.94059,343.27258,25,10000,r +146.15598,353.08607,25,10000,r +172.47561,359.83477,25,10000,r +197.99461,363.52696,25,10000,r +224.44887,366.62713,25,10000,r +250.61899,369.15054,25,10000,r +276.64413,371.43794,25,10000,r +302.38513,373.30103,25,10000,r +328.8038,375.02187,25,10000,r +362.37965,376.81361,25,10000,r +362.02302,378.29875,25,10000,f +332.37013,376.51767,25,10000,f +302.38513,374.30691,25,10000,f +276.2875,372.43691,25,10000,f +250.18987,370.14973,25,10000,f +224.09224,367.60539,25,10000,f +197.99461,364.56046,25,10000,f +171.76235,360.58622,25,10000,f +145.79935,354.29441,25,10000,f +120.06419,344.6711,25,10000,f +96.50966,332.16416,25,10000,f +78.38047,318.38812,25,10000,f +64.96919,304.87018,25,10000,f +55.52755,292.35067,25,10000,f +45.76427,277.21351,25,10000,f +38.50909,263.27997,25,10000,f +32.69795,248.81046,25,10000,f +27.28428,232.47174,25,10000,f +23.28548,218.7881,25,10000,f +18.09699,198.41845,25,10000,f +13.69177,180.16495,25,10000,f +10.59913,165.61854,25,10000,f +7.9527,150.8566,25,10000,f +5.16796,134.53653,25,10000,f +2.65929,116.94405,25,10000,f +0.11092,98.46433,25,10000,f +-3.25597,75.53437,25,10000,f +-6.0239,54.48052,25,10000,f +-8.24916,38.66182,25,10000,f +-10.21676,22.64235,25,10000,f +-12.98252,0.13104,25,10000,f +9.79895,0.06656,100,10000,r +10.83644,21.71613,100,10000,r +12.44007,43.91628,100,10000,r +13.81013,59.7573,100,10000,r +15.34124,73.44888,100,10000,r +16.99772,88.99304,100,10000,r +18.4232,102.89577,100,10000,r +20.55605,119.30787,100,10000,r +23.12024,134.36722,100,10000,r +26.8043,147.85265,100,10000,r +30.47475,161.2344,100,10000,r +36.18893,176.60652,100,10000,r +43.44968,190.13258,100,10000,r +55.7487,203.88238,100,10000,r +73.54959,214.83899,100,10000,r +99.30078,222.48181,100,10000,r +125.40349,225.5791,100,10000,r +151.50553,227.82572,100,10000,r +177.6073,229.71962,100,10000,r +203.70878,231.26081,100,10000,r +229.81009,232.58067,100,10000,r +255.91128,233.74839,100,10000,r +282.0124,234.82619,100,10000,r +308.11341,235.76568,100,10000,r +334.21432,236.57376,100,10000,r +368.78608,237.2052,100,10000,r +368.06962,238.67198,100,10000,f +337.75182,238.02506,100,10000,f +310.23046,237.21629,100,10000,f +281.28833,236.01769,100,10000,f +255.18724,234.97446,100,10000,f +229.08601,233.75834,100,10000,f +202.98478,232.53529,100,10000,f +176.88317,230.84196,100,10000,f +150.78149,229.0518,100,10000,f +124.67956,226.9435,100,10000,f +98.57675,223.72863,100,10000,f +72.4711,216.90726,100,10000,f +48.89914,205.22192,100,10000,f +32.93765,190.8696,100,10000,f +23.5023,177.87634,100,10000,f +16.96623,163.93545,100,10000,f +12.49193,150.23439,100,10000,f +9.7609,137.11673,100,10000,f +6.78265,121.51083,100,10000,f +4.21229,108.00104,100,10000,f +1.94843,92.76812,100,10000,f +-0.35501,78.19346,100,10000,f +-2.32066,60.54942,100,10000,f +-4.52265,39.48042,100,10000,f +-6.52569,21.42548,100,10000,f +-7.57171,0.01386,100,10000,f diff --git a/materialdatabase/data/datasheet_curves/T37/general_information.csv b/materialdatabase/data/datasheet_curves/T37/general_information.csv new file mode 100644 index 0000000..344e488 --- /dev/null +++ b/materialdatabase/data/datasheet_curves/T37/general_information.csv @@ -0,0 +1,2 @@ +application,material,initial permeability,curie temperature in C,density in kg/m^3,resistivity in Ohm m,saturation flux density in T at 25 C,saturation flux density in T at 100 C +power conversion,MnZn,6500,130,4900,0.2,0.38,0.24 diff --git a/materialdatabase/processing/data_structure.py b/materialdatabase/processing/data_structure.py index f41cfa4..a826da4 100644 --- a/materialdatabase/processing/data_structure.py +++ b/materialdatabase/processing/data_structure.py @@ -9,6 +9,8 @@ import pandas as pd from matplotlib import pyplot as plt import numpy as np +from scipy.interpolate import interp1d +from scipy.signal import savgol_filter # own libraries from materialdatabase.meta.data_enums import ComplexDataType, Material, DataSource, FitFunction, \ @@ -593,6 +595,208 @@ def get_datasheet_curve(self, material: Material, curve_type: DatasheetCurveType else: return pd.read_csv(path2file, sep=",") + def get_initial_magnetization_curve(self, material: Material, number_of_values: int, act_T: float, + act_f: float = 10000) -> pd.DataFrame: + """ + Get the initial magnetization curve. + + :param material: Material from material database, e.g. mdb.Material.N95 + :type material: Material + :param number_of_values: Number of values within the initial magnetization curve + :type number_of_values: int + :param act_T: Temperature parameter of the initial magnetization curve + :type act_T: float + :param act_f: Selected frequency of the initial magnetization curve (default value) + :type act_f: float + :return: initial magnetization curve as data frame + :rtype: pd.DataFrame + """ + # Variable declaration + # Interpolation flag + i_flag: bool = False + # Temperature values used in case of interpolation + t1: float = 0 + t2: float = 0 + + act_b_over_h_at_f_T = self.get_datasheet_curve(material, DatasheetCurveType.b_over_h_at_f_T) + + # Check, if actual requested frequency is matches one measurement + if not act_b_over_h_at_f_T['f'].isin([act_f]).any(): + available_f_list = act_b_over_h_at_f_T['f'].unique().tolist() + available_f_list.sort() + raise ValueError("The requested frequency is not available.\n" + f"The available frequencies are {available_f_list}!") + + # Evaluate requested parameter + t_min = act_b_over_h_at_f_T["T"].min() + t_max = act_b_over_h_at_f_T["T"].max() + + # Get available temperatures + available_T_list = act_b_over_h_at_f_T['T'].unique().tolist() + available_T_list.sort() + + # Check, if actual requested temperature is outside the range + if act_T > t_max or act_T < t_min: + t_range = t_max - t_min + if act_T > t_max + (t_range * 0.33) or act_T < t_min - (t_range * 0.33): + raise ValueError("The requested temperature is outside of the available range.\n" + f"The available range is {t_min - (t_range * 0.33)} to {t_max + (t_range * 0.33)}!") + elif act_T < t_min: + if len(available_T_list) < 2: + raise ValueError( + "Serious bug in method 'get_initial_magnetization_curve' in 'act_T < t_min'. Please write an issue!") + t1 = available_T_list[0] + t2 = available_T_list[1] + elif act_T > t_max: + if len(available_T_list) < 2: + raise ValueError( + "Serious bug in method 'get_initial_magnetization_curve' in 'act_T > t_max'. Please write an issue!") + t1 = available_T_list[-2] + t2 = available_T_list[-1] + # Set interpolation flag + i_flag = True + else: + # Check, if the requested temperature is not identical with measurement + if not act_b_over_h_at_f_T['T'].isin([act_T]).any(): + t1 = available_T_list[0] + for t_av in available_T_list: + t2 = t_av + if act_T < t_av: + break + # Overtake the value as low limit + t1 = t_av + i_flag = True + + if i_flag: + init_mag_curve_df_low = self._calculate_initial_magnetization_curve(act_b_over_h_at_f_T, number_of_values, t1, act_f) + init_mag_curve_df_high = self._calculate_initial_magnetization_curve(act_b_over_h_at_f_T, number_of_values, t2, act_f) + + h_low = init_mag_curve_df_low["h"].to_numpy() + b_low = init_mag_curve_df_low["b"].to_numpy() + h_high = init_mag_curve_df_high["h"].to_numpy() + b_high = init_mag_curve_df_high["b"].to_numpy() + # Calculate the available h-range + h_upper_limit = min(h_low.max(), h_high.max()) + h_lower_limit = max(h_low.min(), h_high.min()) + + h_init_mag = np.linspace(h_lower_limit, h_upper_limit, num=number_of_values) + b_interpl_low = interp1d(h_low, b_low, kind='quadratic') + b_interpl_high = interp1d(h_high, b_high, kind='quadratic') + b_low_uniform = b_interpl_low(h_init_mag) + b_high_uniform = b_interpl_high(h_init_mag) + b_init_mag = b_low_uniform + (b_high_uniform - b_low_uniform) * (act_T - t1) / (t2 - t1) + + # Transfer result to dataframe + init_mag_curve_df = pd.DataFrame({"h": h_init_mag, "b": b_init_mag}) + + else: + # Provide the initial magnetization curve + init_mag_curve_df = self._calculate_initial_magnetization_curve(act_b_over_h_at_f_T, number_of_values, act_T, act_f) + + init_mag_curve_df['T'] = act_T + init_mag_curve_df['f'] = act_f + + return init_mag_curve_df + + def _calculate_initial_magnetization_curve(self, act_b_over_h_at_f_T: pd.DataFrame, number_of_values: int, + act_T: float, act_f: float) -> pd.DataFrame: + """Calculate initial magnetization curve. + + :param act_b_over_h_at_f_T: curve data of the hysteresis curve + :type act_b_over_h_at_f_T: pd.DataFrame + :param number_of_values: Number of values within the initial magnetization curve + :type number_of_values: int + :param act_T: Temperature parameter of the initial magnetization curve + :type act_T: float + :param act_f: Selected frequency of the initial magnetization curve + :type act_f: float + :return: initial magnetization curve as data frame + :rtype: pd.DataFrame + """ + # Filter frequency and temperature + curve_data: pd.DataFrame = act_b_over_h_at_f_T[act_b_over_h_at_f_T["T"] == act_T] + # Check if data are available + if not len(curve_data): + return curve_data + curve_data = curve_data[curve_data["f"] == act_f] + # Check if data are available + if not len(curve_data): + return curve_data + curve_data_raising: pd.DataFrame = curve_data[curve_data["branch"] == "r"] + curve_data_raising = curve_data_raising.sort_values(by='h', ascending=True) + curve_data_raising = curve_data_raising.reset_index(drop=True) + curve_data_falling: pd.DataFrame = curve_data[curve_data["branch"] == "f"] + curve_data_falling = curve_data_falling.sort_values(by='h', ascending=True) + curve_data_falling = curve_data_falling.reset_index(drop=True) + + # Check if data are available + if not len(curve_data_raising) or not len(curve_data_falling): + return curve_data + # calculate same data points + + # Extent hysteresis curve for negative b-values for interpolation purpose by mirror curve + # Get mirror range in h-axes + h_min_raising = curve_data_raising["h"].min() + h_min_falling = curve_data_falling["h"].min() + + # Interpolate to intersection with y-axes + h1, b1 = curve_data_raising.iloc[0]['h'], curve_data_raising.iloc[0]['b'] + h2, b2 = curve_data_raising.iloc[1]['h'], curve_data_raising.iloc[1]['b'] + m = (b2 - b1) / (h2 - h1) + h0 = h1 - b1 / m + # Extended part by mirror curve data + curve_data_extension = curve_data_raising.copy() + curve_data_extension['h'] = 2 * h0 - curve_data_extension['h'] + curve_data_extension['b'] = -curve_data_extension['b'] + + # Reduce extended part to h-shift + curve_data_extension = curve_data_extension[curve_data_extension['h'] >= h_min_falling] + curve_data_raising = pd.concat([curve_data_extension, curve_data_raising]) + + # Get b and h-values + h_raising = curve_data_raising["h"].to_numpy() + b_raising = curve_data_raising["b"].to_numpy() + + h_falling = curve_data_falling["h"].to_numpy() + b_falling = curve_data_falling["b"].to_numpy() + + # Provide data for raising and falling interpolation object + interp_raising = interp1d(h_raising, b_raising, kind='quadratic', fill_value="extrapolate") + interp_falling = interp1d(h_falling, b_falling, kind='quadratic', fill_value="extrapolate") + # Get interpolated values for both curves + b_raising_add = interp_raising(h_falling) + b_falling_add = interp_falling(h_raising) + + # Generate initial_magnetization_curve + h_init_mag_curve = np.concatenate([h_raising, h_falling]) + b_init_mag_curve_r = (b_raising + b_falling_add) / 2 + b_init_mag_curve_f = (b_falling + b_raising_add) / 2 + b_init_mag_curve = np.concatenate([b_init_mag_curve_r, b_init_mag_curve_f]) + # Get sort index according h and sort entries + sort_idx = np.argsort(h_init_mag_curve) + h_init_mag_curve = h_init_mag_curve[sort_idx] + b_init_mag_curve = b_init_mag_curve[sort_idx] + # Remove negative b-entries and add start point Pt (0,0), if not existing + b_positiv_mask = (b_init_mag_curve >= 0) + h_init_mag_curve = h_init_mag_curve[b_positiv_mask] + b_init_mag_curve = b_init_mag_curve[b_positiv_mask] + if 0 not in h_init_mag_curve: + h_init_mag_curve = np.insert(h_init_mag_curve, 0, 0) + b_init_mag_curve = np.insert(b_init_mag_curve, 0, 0) + + h_init_mag_filter = np.linspace(h_init_mag_curve.min(), h_init_mag_curve.max(), num=number_of_values) + b_interpl = interp1d(h_init_mag_curve, b_init_mag_curve, kind='quadratic') + b_init_mag_uniform = b_interpl(h_init_mag_filter) + + # Filter with window of 11 and second order + b_init_mag_curve_filter = savgol_filter(b_init_mag_uniform, window_length=11, + polyorder=2) + + # Transfer result to pd-DataFrame + init_mag_curve_df = pd.DataFrame({"h": h_init_mag_filter, "b": b_init_mag_curve_filter}) + + return init_mag_curve_df + def get_datasheet_information(self, material: Material, attribute: DatasheetAttribute) -> Any: """ Get a datasheet attribute value of a certain material.