Skip to content

Commit

Permalink
Documentation of the new waveform model
Browse files Browse the repository at this point in the history
  • Loading branch information
otvam committed Jun 1, 2020
1 parent 84b5ec8 commit b8cdfb0
Show file tree
Hide file tree
Showing 11 changed files with 267 additions and 83 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,13 @@ The releases are available at GitHub and contains:
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
MATLAB 101 1648 4806 4539
MATLAB 102 1724 5017 4703
Python 8 365 451 450
Markdown 4 75 0 281
Markdown 4 76 0 284
DOS Batch 3 9 0 34
Bourne Shell 3 9 9 21
-------------------------------------------------------------------------------
SUM: 119 2106 5266 5325
SUM: 120 2183 5477 5492
-------------------------------------------------------------------------------
```

Expand Down
2 changes: 1 addition & 1 deletion resources/material/run_core.m
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ function run_core()

% assign param
material.param.mu = mu; % material permeability
material.param.beta = beta; % beta of the material (Steinmetz paramter)
material.param.beta = beta; % beta of the material (Steinmetz parameter)
material.param.rho = rho; % volumetric density
material.param.kappa = kappa; % cost per mass

Expand Down
2 changes: 1 addition & 1 deletion run_6_compute_single.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function run_6_compute_single()
run_sub('approx')

% run model with FEM simulation
% run_sub('fem')
run_sub('fem')

end

Expand Down
32 changes: 18 additions & 14 deletions source_inductor/inductor_design/+design_compute/CoreData.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
%
% Map the different unique id with the corresponding data.
% Get constant properties (mass, cost, saturation, etc.).
% Get the losses for sinus flux (lossmap, with DC biais).
% Get the losses for triangular flux (IGGE, lossmap, with DC biais).
% Get the losses for arbitrary current waveforms (iGSE, lossmap, with DC biais).
% The code is completely vectorized.
%
% The input data required by this class require a defined format:
Expand Down Expand Up @@ -124,25 +123,28 @@
% - details: R. Burkart, "Advanced Modeling and Multi-Objective Optimization of Power Electronic Converter Systems", 2016
%
% The input should have the size of the number of samples.
% The signal should be periodic (first point is equal to last point).
% Minor loops are supported.
% Minor loops are supported with the iGSE.
% The amplitudes of the loops should be given (not computed by this code).
% For the loops, the peak to peak amplitude is considered.
%
% The signals are given as matrices:
% The time signals are given as matrices:
% - the columns represents the different samples
% - the rows represents the time sampling
% - the first point and last points are t=0 and t=1/f
% - the signal should be periodic (first point is equal to last point)
%
% Parameters:
% t_vec (matrix): matrix with the times
% B_time_vec (matrix): matrix with the time domain flux densities
% B_loop_vec (matrix): matrix with the major/minor loop flux densities
% B_dc (matrix): vector with the DC flux densities
% B_dc (vector): DC flux densities
% T (vector): operating temperature
%
% Returns:
% is_valid (vector): if the operating points are valid (or not)
% P (vector): losses of each sample (density multiplied with volume)

% parse waveform
% parse waveform, get the frequency and the AC peak value
[f, B_ac_peak] = self.get_param_waveform(t_vec, B_time_vec);

% interpolate the loss map, get the IGSE parameters
Expand Down Expand Up @@ -227,13 +229,15 @@ function parse_data(self, id_vec, id, param_tmp)
function [f, B_ac_peak] = get_param_waveform(self, t_vec, B_time_vec)
% Extract the parameters from the time domain waveform.
%
% The frequency is extracted from the time sampling.
% The AC peak value is the peak to peak value over two.
%
% Parameters:
% t_vec (matrix): matrix with the times
% B_time_vec (matrix): matrix with the flux densities
% B_time_vec (matrix): matrix with the time domain flux densities
%
% Returns:
% f (vector): operating frequency
% B_dc (vector): DC flux density
% B_ac_peak (vector): AC peak flux density

% frequency
Expand All @@ -246,15 +250,15 @@ function parse_data(self, id_vec, id, param_tmp)
function [is_valid, k, alpha, beta] = compute_steinmetz(self, f, B_ac_peak, B_dc, T)
% Compute the losses with the Steinmetz parameters from the loss map.
%
% The Steinmetz paramters are extracted with the following methods:
% The Steinmetz parameters are extracted with the following methods:
% - The losses are computed for: B_ac_peak*(1+eps) and B_ac_peak/(1+eps)
% - The losses are computed for: f*(1+eps) and f/(1+eps)
% - Then, alpha and represents the gradients (in log scale)
% - Finally, k is set in order to get the right absolute value of the losses
%
% Parameters:
% f (vector): frequency excitation vector
% B_ac_peak (vector): peak AC flux density
% f (vector): operating frequency
% B_ac_peak (vector): AC peak flux density
% B_dc (vector): DC flux density
% T (vector): operating temperature
%
Expand Down Expand Up @@ -324,10 +328,10 @@ function parse_data(self, id_vec, id, param_tmp)
B_time_vec_diff = B_time_vec(2:end,:)-B_time_vec(1:end-1,:);
B_loop_vec_diff = (B_loop_vec(2:end,:)+B_loop_vec(1:end-1,:))./2;

% frequency
% get the frequency
f = 1./(max(t_vec, [], 1)-min(t_vec, [], 1));

% apply the iGSE
% apply the iGSE (time dependent losses)
v_int = ki.*(abs(B_loop_vec_diff).^(beta-alpha)).*(abs(B_time_vec_diff./t_vec_diff).^alpha);

% integrate the losses
Expand Down
54 changes: 35 additions & 19 deletions source_inductor/inductor_design/+design_compute/InductorCompute.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
% - check the validity of the design
% - compute many operating points
% - core loss map (DC bias) and winding losses (proximity losses)
% - sinus or PWM excitation
% - sinus or triangular current excitation
% - thermal/loss coupling
%
% Both the magnetic and the thermal model are powered by a ANN data-driven model.
Expand Down Expand Up @@ -177,7 +177,7 @@ function init_magnetic(self)
self.fom.circuit.H_norm = self.fom.geom.n_turn.*fom_mf.H_norm;
self.fom.circuit.L = self.fom.geom.n_turn.^2.*fom_mf.L_norm;

% set the saturation and RMS current properties
% set the saturation, RMS current, and voltage time area properties
B_sat_max = self.core_obj.get_flux_density();
J_rms_max = self.winding_obj.get_current_density();
self.fom.circuit.I_sat = B_sat_max./self.fom.circuit.B_norm;
Expand All @@ -192,7 +192,7 @@ function init_limit(self)
% This function does not compute losses, it is just a rough filter.

% check if the figures of merit are in the right range
is_valid_limit = true(1, self.n_sol);
is_valid_limit = true;
is_valid_limit = is_valid_limit&self.init_is_valid_check(self.fom.volume.V_box, self.data_vec.fom_limit.V_box);
is_valid_limit = is_valid_limit&self.init_is_valid_check(self.fom.cost.c_tot, self.data_vec.fom_limit.c_tot);
is_valid_limit = is_valid_limit&self.init_is_valid_check(self.fom.mass.m_tot, self.data_vec.fom_limit.m_tot);
Expand Down Expand Up @@ -236,7 +236,7 @@ function init_thermal_loss_waveform(self)
self.thermal_losses_iter_obj = design_compute.ThermalLossIter(self.data_const.iter, fct);

% waveform model
self.waveform_model_obj = design_compute.WaveformModel(self.data_const.signal, self.n_sol);
self.waveform_model_obj = design_compute.WaveformModel(self.n_sol, self.data_const.signal);
end

end
Expand All @@ -255,7 +255,7 @@ function init_thermal_loss_waveform(self)
% make sure that all the samples have the right dimension
excitation = get_struct_size(excitation, self.n_sol);

% init, compute data which are independent of the iterations
% init, compute the data which are independent of the iterations
operating = self.get_operating_init(excitation);

% compute the coupled loss and thermal models
Expand All @@ -275,35 +275,48 @@ function init_thermal_loss_waveform(self)
function operating = get_operating_init(self, excitation)
% Initialize an operating point with the data which are independent of the iterations.
%
% Compute the waveforms and the associated figures of merit.
% Initialize the thermal data for the first thermal loss iteration.
%
% Parameters:
% excitation (struct): struct containing the operating point excitation
%
% Returns:
% operating (struct): struct with the operating point data

operating = struct();
operating = self.get_thermal_init(operating, excitation.thermal);
operating = self.get_waveform_init(operating, excitation.waveform);
operating = self.get_thermal_init(operating, excitation.thermal);
end

function operating = get_waveform_init(self, operating, excitation)
% Compute the waveforms and the associated figures of merit.
%
% Parameters:
% operating (struct): struct with the operating point data
% excitation (struct): struct containing the waveform parameters
%
% Returns:
% operating (struct): struct with the operating point data

% set the waveform
self.waveform_model_obj.set_excitation(excitation);

% get component circuit parameters
% get the inductor circuit and field parameters
B_norm = self.fom.circuit.B_norm;
J_norm = self.fom.circuit.J_norm;
H_norm = self.fom.circuit.H_norm;
L = self.fom.circuit.L;
I_sat = self.fom.circuit.I_sat;
I_rms = self.fom.circuit.I_rms;

% get the waveform
% get the current waveform parameters
operating.waveform = self.waveform_model_obj.get_waveform(L, I_sat, I_rms);

% get the inductor field values
operating.field = self.waveform_model_obj.get_field(J_norm, H_norm, B_norm);
end


function operating = get_thermal_init(self, operating, excitation)
% Init the thermal model for the starting the thermal/loss iterations.
%
Expand All @@ -314,7 +327,7 @@ function init_thermal_loss_waveform(self)
% Returns:
% operating (struct): struct with the operating point data

% set the excitation
% get the ambient condition
thermal.T_ambient = excitation.T_ambient;
thermal.h_convection = excitation.h_convection;

Expand Down Expand Up @@ -345,7 +358,7 @@ function init_thermal_loss_waveform(self)
% Returns:
% operating (struct): struct with the operating point data

% get operating condition
% get the ambient condition and the losses
T_ambient = operating.thermal.T_ambient;
h_convection = operating.thermal.h_convection;
P_core = operating.losses.P_core;
Expand Down Expand Up @@ -373,20 +386,22 @@ function init_thermal_loss_waveform(self)
end

function [thermal, is_valid_thermal] = check_thermal_limit(self, thermal, is_valid_thermal)
% Check the validity of the temperatures.
% Compute the thermal stress and check the validity of the temperatures.
%
% Parameters:
% thermal (struct): struct with the thermal data
% is_valid_thermal (vector): if the temperatures are valid (or not)
%
% Returns:
% thermal (struct): struct with the thermal data
% is_valid_thermal (vector): if the temperatures are valid (or not)

% get the limits
T_core_max = self.core_obj.get_temperature();
T_winding_max = self.winding_obj.get_temperature();
T_iso_max = self.iso_obj.get_temperature();

% compute max
% extract the differemt temperatures
T_ambient = thermal.T_ambient;
T_core = max(thermal.T_core_max, thermal.T_core_avg);
T_winding = max(thermal.T_winding_max, thermal.T_winding_avg);
Expand All @@ -397,8 +412,10 @@ function init_thermal_loss_waveform(self)
is_valid_winding = T_winding<=T_winding_max;
is_valid_iso = T_iso<=T_iso_max;

% check the thermal utilization
% assign the maximum temperature
thermal.T_max = max([T_core ; T_winding ; T_iso], [], 1);

% check the thermal utilization (temperature elevation compared to the limit)
thermal.stress_core = (T_core-T_ambient)./(T_core_max-T_ambient);
thermal.stress_winding = (T_winding-T_ambient)./(T_winding_max-T_ambient);
thermal.stress_iso = (T_iso-T_ambient)./(T_iso_max-T_ambient);
Expand Down Expand Up @@ -437,30 +454,29 @@ function init_thermal_loss_waveform(self)
%
% Core losses with the core data manager.
% Winding losses with the winding data manager.
% Compute different figures of merit.
%
% Parameters:
% operating (struct): struct with the operating point data
%
% Returns:
% operating (struct): struct with the operating point data

% get component circuit parameters
% get inductor field parameters
B_norm = self.fom.circuit.B_norm;
J_norm = self.fom.circuit.J_norm;
H_norm = self.fom.circuit.H_norm;

% get the applied stress
% get the applied temperatures
T_core_avg = operating.thermal.T_core_avg;
T_winding_avg = operating.thermal.T_winding_avg;

% get the time domain waveform
% get the stress applied to the core (time domain)
[t_vec, B_time_vec, B_loop_vec, B_dc] = self.waveform_model_obj.get_core(B_norm);

% compute the core losses
[is_valid_core, P_core] = self.core_obj.get_losses(t_vec, B_time_vec, B_loop_vec, B_dc, T_core_avg);

% get the Fourier coefficient of the waveform
% get the stress applied to the winding (Fourier harmonics)
[f_vec, J_freq_vec, H_freq_vec, J_dc] = self.waveform_model_obj.get_winding(J_norm, H_norm);

% compute the winding losses
Expand Down
Loading

0 comments on commit b8cdfb0

Please sign in to comment.