Skip to content

Commit

Permalink
Merge pull request #144 from upb-lea/induc_opti_fix
Browse files Browse the repository at this point in the history
fixed bugs regarding issue #142
  • Loading branch information
gituser789 authored Jan 7, 2025
2 parents 1fc23ff + dcbcdec commit 0ea1288
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions femmt/examples/inductor_optimization.py
Original file line number Diff line number Diff line change
Expand Up @@ -850,8 +850,8 @@ def filter_reluctance_losses(self, data_matrix):
p_hyst_density_middle = \
0.5 * (2 * np.pi * self.frequency) * mu_r_imag * fmt.mu_0 * \
((data_matrix[:, self.param["total_flux_max"]] / (fmt.mu_0 * data_matrix[:, self.param["mu_r_abs"]])) ** 2) * \
(1 / (2 * np.pi * data_matrix[:, self.param["core_h_middle"]])) * np.log((data_matrix[:, self.param["r_inner"]] * 2) / \
data_matrix[:, self.param["core_inner_diameter"]])
(1 / (2 * np.pi * data_matrix[:, self.param["core_h_middle"]])) * np.log((data_matrix[:, self.param["r_inner"]].astype(np.float64) * 2) / \
data_matrix[:, self.param["core_inner_diameter"]].astype(np.float64))
p_hyst_density_outer = p_hyst_outer * volume_outer
total_hyst_loss = p_hyst_density_center + (2 * p_hyst_density_middle) + p_hyst_density_outer

Expand Down Expand Up @@ -928,7 +928,7 @@ def filter_reluctance_pareto_front_tolerance(self, data_matrix: np.array, factor
:type factor_min_dc_losses: float
"""
total_loss_vec = data_matrix[:, self.param["total_loss"]]
total_volume_vec = data_matrix[:, self.param["total_volume"]]
total_volume_vec = data_matrix[:, self.param["total_volume"]].astype(np.float64)

min_total_loss = np.min(total_loss_vec)
print(f"{min_total_loss=}")
Expand Down Expand Up @@ -1016,6 +1016,9 @@ def fem_simulation(self, count: Optional[int] = None):
winding_window = fmt.WindingWindow(core, insulation)
vww = winding_window.split_window(fmt.WindingWindowSplit.NoSplit)

if self.data_matrix_fem[count, self.param["litz_fill_factor"]] is None:
self.data_matrix_fem[count, self.param["litz_fill_factor"]] = np.NAN

# 6. create conductor and set parameters: use solid wires
winding = fmt.Conductor(0, fmt.Conductivity.Copper)
if np.isnan(self.data_matrix_fem[count, self.param["solid_conductor_r"]]):
Expand Down

0 comments on commit 0ea1288

Please sign in to comment.