Skip to content

Commit

Permalink
Merge pull request #6 from upb-lea/develop
Browse files Browse the repository at this point in the history
Fixed material
  • Loading branch information
gituser789 authored Nov 3, 2023
2 parents 4cfb4ac + 656fe0d commit 0863ab8
Show file tree
Hide file tree
Showing 6 changed files with 193 additions and 228 deletions.
255 changes: 102 additions & 153 deletions materialdatabase/data/material_data_base.json
Original file line number Diff line number Diff line change
Expand Up @@ -10234,7 +10234,7 @@
"data_type": "complex_permeability_data",
"name": "LEA_MTB",
"company": "Paderborn University",
"date": "2023-08-23",
"date": "2023-11-03",
"test_setup": {
"name": "LEA_MTB",
"Toroid": "R_25.0x21.0x15.0x4x4",
Expand Down Expand Up @@ -10568,66 +10568,63 @@
"frequency": 150000,
"flux_density": [
0.0,
0.06061052631578947,
0.07452105263157895,
0.08843157894736842,
0.10234210526315789,
0.11625263157894736,
0.13016315789473684,
0.1440736842105263,
0.15798421052631578,
0.17189473684210524,
0.18580526315789472,
0.19971578947368418,
0.21362631578947366,
0.22753684210526312,
0.2414473684210526,
0.25535789473684206,
0.26926842105263155,
0.28317894736842103,
0.2970894736842105
0.06183157894736842,
0.07654736842105264,
0.09126315789473685,
0.10597894736842106,
0.12069473684210527,
0.13541052631578948,
0.1501263157894737,
0.1648421052631579,
0.17955789473684214,
0.19427368421052632,
0.20898947368421056,
0.22370526315789474,
0.23842105263157898,
0.25313684210526316,
0.2678526315789474,
0.2825684210526316,
0.2972842105263158
],
"mu_r_abs": [
2885.8663655235096,
3399.3542088657264,
3517.203146860992,
3620.3384578354526,
3708.7601417891083,
3782.4681987219587,
3841.4626286340044,
3885.7434315252453,
3915.310607395681,
3930.164156245312,
3930.3040780741376,
3915.7303728821585,
3886.443040669374,
3842.4420814357854,
3783.727495181391,
3710.299281906192,
3622.157441610188,
3519.301974293379,
3401.732879955765
2917.309623002487,
3404.4049155396265,
3520.332600076045,
3619.651165064367,
3702.360610504593,
3768.460936396723,
3817.9521427407562,
3850.8342295366933,
3867.107196784534,
3866.7710444842583,
3849.825772635927,
3816.271381239479,
3766.107870294935,
3699.3352398022944,
3615.9534897615576,
3515.962620172724,
3399.362631035795,
3266.15352235077
],
"mu_phi_deg": [
0.0,
2.9864146596676746,
4.412969233928187,
5.7402761610727335,
6.96833544110131,
8.09714707401392,
9.12671105981056,
10.057027398491234,
10.888096090055937,
11.619917134504675,
12.252490531837443,
12.785816282054245,
13.219894385155078,
13.554724841139942,
13.79030765000884,
13.926642811761766,
13.963730326398728,
13.90157019391972,
13.740162414324745
4.137709059214803,
5.916714033336286,
7.55640792288921,
9.056790727873572,
10.417862448289377,
11.63962308413662,
12.722072635415302,
13.665211102125424,
14.46903848426691,
15.13355478183999,
15.65875999484443,
16.044654123280313,
16.291237167147635,
16.3985091264464,
16.3664700011766,
16.195119791338243,
15.884458496931323
]
},
{
Expand Down Expand Up @@ -10822,7 +10819,7 @@
"data_type": "complex_permeability_data",
"name": "LEA_MTB_small_signal",
"company": "Paderborn University",
"date": "2023-08-18",
"date": "2023-10-06",
"test_setup": {
"name": "LEA_MTB_small_signal",
"Toroid": "R_25.0x21.0x15.0x4x4",
Expand Down Expand Up @@ -11056,102 +11053,6 @@
"comment": ""
},
"measurement_data": [
{
"temperature": 75,
"frequencies": [
49657.1,
99641.2,
199939.0,
299500.0,
397759.0,
497400.0,
595828.0,
695558.0,
798138.0,
892526.0,
998075.0,
1097080.0,
1195580.0
],
"epsilon_r": [
198198.55842655932,
148941.7973608258,
119033.64563663349,
106689.37382050959,
99600.94597864692,
94806.761749762,
91380.15870129148,
88774.9376554221,
86683.38831414153,
85139.64930574504,
83711.09498092136,
82677.32724657784,
81777.20739304661
],
"epsilon_phi_deg": [
45.6211,
36.6829,
30.0958,
27.252000000000013,
25.642399999999995,
24.61819999999999,
23.955700000000014,
23.544000000000022,
23.314800000000005,
23.23269999999998,
23.2593,
23.4327,
23.608399999999996
]
},
{
"temperature": 22,
"frequencies": [
46395.0,
95537.5,
196733.0,
282311.0,
359166.0,
456944.0,
581340.0,
655713.0,
739601.0,
834221.0,
940947.0,
1061330.0,
1197110.0
],
"epsilon_r": [
154131.49284741294,
127915.80940347527,
109737.74759304833,
102302.3587291068,
97723.45059609711,
93377.97543000017,
89177.22440626642,
87121.20841701057,
85090.83061279113,
83080.26846304724,
81118.33288929317,
79102.23287630468,
77101.63601826086
],
"epsilon_phi_deg": [
30.691799999999997,
24.923499999999994,
21.73369999999999,
20.97580000000001,
20.743799999999997,
20.712,
20.872500000000002,
21.020000000000017,
21.222499999999982,
21.475499999999972,
21.783400000000007,
22.147500000000004,
22.54210000000001
]
},
{
"temperature": 30,
"frequencies": [
Expand Down Expand Up @@ -11295,6 +11196,54 @@
23.100399999999997,
23.2518
]
},
{
"temperature": 75,
"frequencies": [
49657.1,
99641.2,
199939.0,
299500.0,
397759.0,
497400.0,
595828.0,
695558.0,
798138.0,
892526.0,
998075.0,
1097080.0,
1195580.0
],
"epsilon_r": [
198198.55842655932,
148941.7973608258,
119033.64563663349,
106689.37382050959,
99600.94597864692,
94806.761749762,
91380.15870129148,
88774.9376554221,
86683.38831414153,
85139.64930574504,
83711.09498092136,
82677.32724657784,
81777.20739304661
],
"epsilon_phi_deg": [
45.6211,
36.6829,
30.0958,
27.252000000000013,
25.642399999999995,
24.61819999999999,
23.955700000000014,
23.544000000000022,
23.314800000000005,
23.23269999999998,
23.2593,
23.4327,
23.608399999999996
]
}
]
}
Expand Down
19 changes: 13 additions & 6 deletions materialdatabase/material_data_base_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ def permeability_data_to_pro_file(self, temperature: float, frequency: float, ma
check_input_permeability_data(datasource, material_name, temperature, frequency)

if datasource == MaterialDataSource.Measurement:
self.mdb_print(f"{material_name = }\n")
self.mdb_print(f"{datatype = }\n")
self.mdb_print(f"{measurement_setup = }\n")
permeability_data = self.data[f"{material_name.value}"][f"measurements"][f"{datatype.value}"][f"{measurement_setup.value}"][
"measurement_data"]
# mdb_print(f"{permeability_data = }")
Expand Down Expand Up @@ -269,7 +272,6 @@ def get_material_attribute(self, material_name: str, attribute: str):
"""

value = self.data[f"{material_name.value}"]["manufacturer_datasheet"][f"{attribute}"]
self.mdb_print(f'value=', value)
return value

def get_saturation_flux_density(self, material_name: str):
Expand Down Expand Up @@ -720,11 +722,16 @@ def load_permittivity_measurement(self, material_name: str, datasource: str = "m
:return: dictionary of required data
"""
# Load all available permittivity data from datasource
self.mdb_print(f"{material_name = }"
f"{datasource = }"
f"{datatype = }"
f"{measurement_setup =}")
return self.data[material_name][datasource][datatype][measurement_setup]["measurement_data"]
self.mdb_print(f"{material_name = }\n"
f"{datasource = }\n"
f"{datatype = }\n"
f"{measurement_setup =}")

try:
return self.data[material_name][datasource][datatype][measurement_setup]["measurement_data"]
except:
raise ValueError("Requested measurement data not available.")


def get_permittivity(self, temperature: float, frequency: float, material_name: str,
datasource: str = "measurements",
Expand Down
2 changes: 0 additions & 2 deletions materialdatabase/material_data_base_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1215,14 +1215,12 @@ def get_all_frequencies_for_material(material_path):

def get_all_temperatures_for_directory(toroid_path):
temperatures_str = os.listdir(toroid_path)
print(temperatures_str)
temperatures = []
for f_str in temperatures_str:
try:
temperatures.append(int(f_str))
except:
pass
# print(temperatures)
return temperatures


Expand Down
7 changes: 1 addition & 6 deletions materialdatabase/scripts/write_LEA_MTB_data_into_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,13 @@
# Set parameters
measurement_device = MeasurementDevice.ZESZimmer
material_name = Material.DMR96A2
print(material_name)
print(type(material_name))
toroid_name = ToroidDirectoryName.DMR96A_2
create_permeability_measurement_in_database(Material.DMR96A2, MeasurementSetup.LEA_MTB, company=Company.UPB, date=str(date.today()), test_setup_name=MeasurementSetup.LEA_MTB,
toroid_dimensions=toroid_name, measurement_method=MeasurementMethod.Electric, equipment_names=MeasurementDevice.ZESZimmer)


# General Path to measurements destination
mtb_post_pro_path = os.path.join(my_MTB_measurements_path, "post_processing_data_17_08_2023")
material_path = os.path.join(mtb_post_pro_path, measurement_device, "permeability", material_name)
print(material_path)
frequencies = get_all_frequencies_for_material(material_path)

fig, ax = plt.subplots(3)
Expand All @@ -38,5 +34,4 @@

if write_data:
write_permeability_data_into_database(frequency, T, b_ref, mu_r, mu_phi_deg, material_name, MeasurementSetup.LEA_MTB)

plt.show()
plt.show()
Loading

0 comments on commit 0863ab8

Please sign in to comment.