1 Welcome to the Pareto DAB (Dual Active Bridge) Tool

1.1 Installation

Install the Toolbox as a developer

pip install -e .

2 DAB Computational Toolbox (DCT) documentation

Init python files as modules.

class dct.Breakpoints(*, circuit_pareto: Literal['no', 'pause', 'stop'], circuit_filtered: Literal['no', 'pause', 'stop'], inductor: Literal['no', 'pause', 'stop'], transformer: Literal['no', 'pause', 'stop'], heat_sink: Literal['no', 'pause', 'stop'], summary: Literal['no', 'pause', 'stop'])

Bases: BaseModel

Flow control breakpoints.

circuit_filtered: Literal['no', 'pause', 'stop']
circuit_pareto: Literal['no', 'pause', 'stop']
heat_sink: Literal['no', 'pause', 'stop']
inductor: Literal['no', 'pause', 'stop']
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

summary: Literal['no', 'pause', 'stop']
transformer: Literal['no', 'pause', 'stop']
class dct.CalcCurrents(**kwargs)

Bases: object

DTO contains calculated RMS currents.

angles_rad_sorted: ndarray
angles_rad_unsorted: ndarray
i_hf_1_rms: ndarray
i_hf_1_sorted: ndarray
i_hf_2_rms: ndarray
i_hf_2_sorted: ndarray
i_l_1_rms: ndarray
i_l_1_sorted: ndarray
i_l_2_rms: ndarray
i_l_2_sorted: ndarray
i_l_s_rms: ndarray
i_l_s_sorted: ndarray
i_m1_rms: ndarray
i_m2_rms: ndarray
class dct.CalcFromCircuitConfig(**kwargs)

Bases: object

DTO calculates parameters for the next simulations, which can be derived from the input values.

Lc2_: ndarray
c_oss_1: ndarray
c_oss_2: ndarray
c_oss_par_1: ndarray
c_oss_par_2: ndarray
mesh_P: ndarray
mesh_V1: ndarray
mesh_V2: ndarray
q_oss_1: ndarray
q_oss_2: ndarray
t_j_1: float64
t_j_2: float64
class dct.CalcLosses(**kwargs)

Bases: object

DTO contains the calculated losses.

p_dab_conduction: ndarray
p_m1_conduction: ndarray
p_m2_conduction: ndarray
class dct.CalcModulation(**kwargs)

Bases: object

DTO contains calculated modulation parameters.

mask_IIIm1: ndarray
mask_IIm2: ndarray
mask_Im2: ndarray
mask_m1n: ndarray
mask_m1p: ndarray
mask_zvs: ndarray
mask_zvs_coverage: ndarray
mask_zvs_coverage_notnan: ndarray
phi: ndarray
tau1: ndarray
tau2: ndarray
class dct.Circuit(*, number_of_trials: int, calculation_mode: Literal['new', 'continue', 'skip'], subdirectory: str)

Bases: BaseModel

Flow control for the circuit.

calculation_mode: Literal['new', 'continue', 'skip']
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

number_of_trials: int
subdirectory: str
class dct.CircuitConfig(**kwargs)

Bases: object

Input configuration DTO for the DAB converter.

Lc1: float64
Lc2: float64
Ls: float64
P_max: float64
P_min: float64
P_step: float64
V1_max: float64
V1_min: float64
V1_step: float64
V2_max: float64
V2_min: float64
V2_step: float64
c_par_1: float64
c_par_2: float64
fs: float64
n: float64
transistor_dto_1: TransistorDTO
transistor_dto_2: TransistorDTO
class dct.CircuitDabDTO(timestamp: ndarray | None, name: str, metadata: ndarray | None, input_config: CircuitConfig, calc_config: CalcFromCircuitConfig, calc_modulation: CalcModulation, calc_currents: CalcCurrents, calc_losses: CalcLosses | None, gecko_additional_params: GeckoAdditionalParameters, gecko_results: GeckoResults | None, gecko_waveforms: GeckoWaveforms | None, inductor_results: InductorResults | None, stacked_transformer_results: StackedTransformerResults | None)

Bases: object

Main DabDTO containing all input parameters, calculations and simulation results.

calc_config: CalcFromCircuitConfig
calc_currents: CalcCurrents
calc_losses: CalcLosses | None
calc_modulation: CalcModulation
gecko_additional_params: GeckoAdditionalParameters
gecko_results: GeckoResults | None
gecko_waveforms: GeckoWaveforms | None
inductor_results: InductorResults | None
input_config: CircuitConfig
metadata: ndarray | None
name: str
stacked_transformer_results: StackedTransformerResults | None
timestamp: ndarray | None
class dct.CircuitFilter(number_filtered_designs: int, difference_percentage: float)

Bases: object

Filter the results.

difference_percentage: float
number_filtered_designs: int
class dct.CircuitOptimization

Bases: object

Optimize the DAB converter regarding maximum ZVS coverage and minimum conduction losses.

static calculate_fix_parameters(dab_config: CircuitParetoDabDesign) FixedParameters

Calculate time-consuming parameters which are same for every single simulation.

Parameters:

dab_config (p_dtos.CircuitParetoDabDesign) – DAB circuit configuration

Returns:

Fix parameters (transistor DTOs)

Return type:

d_dtos.FixedParameters

static create_sqlite_database_url(dab_config: CircuitParetoDabDesign) str

Create the DAB circuit optimization sqlite URL.

Parameters:

dab_config (p_dtos.CircuitParetoDabDesign) – DAB optimization configuration file

Returns:

SQLite URL

Return type:

str

static df_plot_pareto_front(df: DataFrame, figure_size: tuple) None

Plot an interactive Pareto diagram (losses vs. volume) to select the transformers to re-simulate.

Parameters:
  • df (pd.DataFrame) – DataFrame, generated from an optuna study (exported by optuna)

  • figure_size (tuple) – figure size as x,y-tuple in mm, e.g. (160, 80)

static df_to_dab_dto_list(dab_config: CircuitParetoDabDesign, df: DataFrame) list[CircuitDabDTO]

Load a DAB-DTO from an optuna study.

Parameters:
  • dab_config (p_dtos.CircuitParetoDabDesign) – DAB optimization configuration file

  • df (pd.DataFrame) – Pandas DataFrame to convert to the DAB-DTO list

Returns:

static filter_df(df: DataFrame, x: str = 'values_0', y: str = 'values_1', factor_min_dc_losses: float = 1.2, factor_max_dc_losses: float = 10) DataFrame

Remove designs with too high losses compared to the minimum losses.

Parameters:
  • df (pd.DataFrame) – pandas DataFrame with study results

  • x (str) – x-value name for Pareto plot filtering

  • y (str) – y-value name for Pareto plot filtering

  • factor_min_dc_losses (float) – filter factor for the minimum dc losses

  • factor_max_dc_losses (float) – dc_max_loss = factor_max_dc_losses * min_available_dc_losses_in_pareto_front

Returns:

pandas DataFrame with Pareto front near points

Return type:

pd.DataFrame

static filter_study_results(dab_config: CircuitParetoDabDesign) None

Filter the study result and use GeckoCIRCUITS for detailed calculation.

Parameters:

dab_config (p_dtos.CircuitParetoDabDesign) – DAB configuration DTO

static is_pareto_efficient(costs: ndarray, return_mask: bool = True) ndarray

Find the pareto-efficient points.

Parameters:
  • costs (np.array) – An (n_points, n_costs) array

  • return_mask (bool) – True to return a mask

Returns:

An array of indices of pareto-efficient points. If return_mask is True, this will be an (n_points, ) boolean array Otherwise it will be a (n_efficient_points, ) integer array of indices.

Return type:

np.array

static load_config(circuit_project_directory: str, circuit_study_name: str) CircuitParetoDabDesign

Load pickle configuration file from disk.

Parameters:
  • circuit_project_directory (str) – project directory

  • circuit_study_name (str) – name of the circuit study

Returns:

Configuration file as p_dtos.DabDesign

Return type:

p_dtos.CircuitParetoDabDesign

static load_csv_to_df(csv_filepath: str) DataFrame

Load a csv file (previously stored from a Pandas DataFrame) back to a Pandas DataFrame.

Parameters:

csv_filepath (str) – File path of .csv file

Returns:

loaded results from the given .csv file

Return type:

pandas.DataFrame

static load_dab_dto_from_study(dab_config: CircuitParetoDabDesign, trial_number: int | None = None) CircuitDabDTO

Load a DAB-DTO from an optuna study.

Parameters:
  • dab_config (p_dtos.CircuitParetoDabDesign) – DAB optimization configuration file

  • trial_number (int) – trial number to load to the DTO

Returns:

static load_filepaths(project_directory: str) ParetoFilePaths

Load file path of the subdirectories of the project.

Parameters:

project_directory (str) – project directory file path

Returns:

File path in a DTO

Return type:

p_dtos.ParetoFilePaths

static objective(trial: Trial, dab_config: CircuitParetoDabDesign, fixed_parameters: FixedParameters) tuple

Objective function to optimize.

Parameters:
  • dab_config (p_dtos.CircuitParetoDabDesign) – DAB optimization configuration file

  • trial (optuna.Trial) – optuna trial

  • fixed_parameters (d_dtos.FixedParameters) – fixed parameters (loaded transistor DTOs)

Returns:

static pareto_front_from_df(df: DataFrame, x: str = 'values_0', y: str = 'values_1') DataFrame

Calculate the Pareto front from a Pandas DataFrame. Return a Pandas DataFrame.

Parameters:
  • df (pd.DataFrame) – Pandas DataFrame

  • x (str) – Name of x-parameter from df to show in Pareto plane

  • y (str) – Name of y-parameter from df to show in Pareto plane

Returns:

Pandas DataFrame with pareto efficient points

Return type:

pd.DataFrame

static run_optimization_mysql(act_storage_url: str, act_study_name: str, act_number_trials: int, act_dab_config: CircuitParetoDabDesign, act_fixed_parameters: FixedParameters) None

Proceed a study which is stored as sqlite database.

Parameters:
  • act_storage_url (str) – url-Name of the database path

  • act_study_name (str) – Study information configuration

  • act_number_trials (int) – Number of trials adding to the existing study

  • act_dab_config (p_dtos.CircuitParetoDabDesign) – DAB optimization configuration file

  • act_fixed_parameters (d_dtos.FixedParameters) – fix configuration parameters for the optimization process

static run_optimization_sqlite(act_study: Study, act_study_name: str, act_number_trials: int, act_dab_config: CircuitParetoDabDesign, act_fixed_parameters: FixedParameters) None

Proceed a study which is stored as sqlite database.

Parameters:
  • act_study (optuna.Study) – Study information configuration

  • act_study_name (str) – Study information configuration

  • act_number_trials (int) – Number of trials adding to the existing study

  • act_dab_config (p_dtos.CircuitParetoDabDesign) – DAB optimization configuration file

  • act_fixed_parameters (d_dtos.FixedParameters) – fix configuration parameters for the optimization process

static save_config(config: CircuitParetoDabDesign) None

Save the configuration file as pickle file on the disk.

Parameters:

config (InductorOptimizationDTO) – configuration

static show_study_results(dab_config: CircuitParetoDabDesign) None

Show the results of a study.

A local .html file is generated under config.working_directory to store the interactive plotly plots on disk.

Parameters:

dab_config (p_dtos.CircuitParetoDabDesign) – DAB optimization configuration file

static start_proceed_study(dab_config: ~dct.circuit_optimization_dtos.CircuitParetoDabDesign, number_trials: int, database_type: str = 'sqlite', sampler: ~optuna.samplers._base.BaseSampler = <optuna.samplers._nsgaiii._sampler.NSGAIIISampler object>) None

Proceed a study which is stored as sqlite database.

Parameters:
  • dab_config (p_dtos.CircuitParetoDabDesign) – DAB optimization configuration file

  • number_trials (int) – Number of trials adding to the existing study

  • database_type (str) – storage database, e.g. ‘sqlite’ or ‘mysql’

  • sampler (optuna.sampler-object) – optuna.samplers.NSGAIISampler() or optuna.samplers.NSGAIIISampler(). Note about the brackets () !! Default: NSGAIII

static study_to_df(dab_config: CircuitParetoDabDesign) DataFrame

Create a DataFrame from a study.

Parameters:

dab_config (p_dtos.CircuitParetoDabDesign) – DAB optimization configuration file

class dct.CircuitOutputRange(v_1_min_nom_max_list: list, v_2_min_nom_max_list: list, p_min_nom_max_list: list, steps_per_direction: int)

Bases: object

Definition of the DAB operating area.

p_min_nom_max_list: list
steps_per_direction: int
v_1_min_nom_max_list: list
v_2_min_nom_max_list: list
class dct.CircuitParetoDabDesign(circuit_study_name: str, project_directory: str, design_space: CircuitParetoDesignSpace, output_range: CircuitOutputRange, filter: CircuitFilter)

Bases: object

Config to optimize the Dual-Active Bridge (DAB) converter.

circuit_study_name: str
design_space: CircuitParetoDesignSpace
filter: CircuitFilter
output_range: CircuitOutputRange
project_directory: str
class dct.CircuitParetoDesignSpace(f_s_min_max_list: list[int], l_s_min_max_list: list[float], l_1_min_max_list: list[float], l_2__min_max_list: list[float], n_min_max_list: list[float], transistor_1_name_list: list[str], transistor_2_name_list: list[str], c_par_1: float, c_par_2: float)

Bases: object

Definition of the hardware design space for electronic components.

c_par_1: float
c_par_2: float
f_s_min_max_list: list[int]
l_1_min_max_list: list[float]
l_2__min_max_list: list[float]
l_s_min_max_list: list[float]
n_min_max_list: list[float]
transistor_1_name_list: list[str]
transistor_2_name_list: list[str]
class dct.CondBreakpoints(*, circuit: int, inductor: int, transformer: int, heat_sink: int)

Bases: BaseModel

Flow control conditional breakpoints.

circuit: int
heat_sink: int
inductor: int
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

transformer: int
class dct.ConfigurationDataFiles(*, circuit_configuration_file: str, inductor_configuration_file: str, transformer_configuration_file: str, heat_sink_configuration_file: str)

Bases: BaseModel

File paths to the configuration files.

circuit_configuration_file: str
heat_sink_configuration_file: str
inductor_configuration_file: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

transformer_configuration_file: str
class dct.FilterData(filtered_list_id: list[int], filtered_list_pathname: str, circuit_study_name: str)

Bases: object

Information about the filtered circuit designs.

circuit_study_name: str
filtered_list_id: list[int]
filtered_list_pathname: str
class dct.FixedParameters(transistor_1_dto_list: list[TransistorDTO], transistor_2_dto_list: list[TransistorDTO])

Bases: object

Fixed parameters for the circuit optimization.

transistor_1_dto_list: list[TransistorDTO]
transistor_2_dto_list: list[TransistorDTO]
class dct.FlowControl(*, general: General, breakpoints: Breakpoints, conditional_breakpoints: CondBreakpoints, circuit: Circuit, inductor: Inductor, transformer: Transformer, heat_sink: HeatSink, summary: Summary, configuration_data_files: ConfigurationDataFiles)

Bases: BaseModel

General flow control class.

breakpoints: Breakpoints
circuit: Circuit
conditional_breakpoints: CondBreakpoints
configuration_data_files: ConfigurationDataFiles
general: General
heat_sink: HeatSink
inductor: Inductor
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

summary: Summary
transformer: Transformer
class dct.GeckoAdditionalParameters(**kwargs)

Bases: object

Additional parameters for the GeckoCIRCUITS simulation, like simulation time or some file paths.

lossfilepath: str
number_pre_sim_periods: int
number_sim_periods: int
simfilepath: str
t_dead1: ndarray
t_dead2: ndarray
timestep: float64
timestep_pre: float64
class dct.GeckoResults(**kwargs)

Bases: object

DTO contains the result of the GeckoCIRCUITS simulation.

I1_squared_total_mean: ndarray
S11_p_cond: ndarray
S11_p_sw: ndarray
S12_p_cond: ndarray
S12_p_sw: ndarray
S23_p_cond: ndarray
S23_p_sw: ndarray
S24_p_cond: ndarray
S24_p_sw: ndarray
i_C11: ndarray
i_C12: ndarray
i_C23: ndarray
i_C24: ndarray
i_HF1: ndarray
i_HF1_S11_sw_on: ndarray
i_HF1_total_mean: ndarray
i_HF2: ndarray
i_HF2_S23_sw_on: ndarray
i_Lc1: ndarray
i_Lc2: ndarray
i_Ls: ndarray
i_S11: ndarray
i_S12: ndarray
i_S23: ndarray
i_S24: ndarray
i_dc1: ndarray
i_dc2: ndarray
p_cond1: ndarray
p_cond2: ndarray
p_dc1: ndarray
p_dc2: ndarray
p_sw1: ndarray
p_sw2: ndarray
power_deviation: ndarray
v_dc1: ndarray
v_dc2: ndarray
v_ds_S11_sw_on: ndarray
v_ds_S23_sw_on: ndarray
zvs_coverage: ndarray
zvs_coverage1: ndarray
zvs_coverage1_notnan: ndarray
zvs_coverage2: ndarray
zvs_coverage2_notnan: ndarray
zvs_coverage_notnan: ndarray
class dct.GeckoWaveforms(**kwargs)

Bases: object

DTO contains the waveform result of the GeckoCIRCUITS simulation.

i_HF1: ndarray
i_HF2: ndarray
i_Lc1: ndarray
i_Lc2: ndarray
i_Ls: ndarray
time: ndarray
class dct.General(*, project_directory: str)

Bases: BaseModel

General flow control information.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

project_directory: str
class dct.HandleDabDto

Bases: object

Class to handle the DabDTO, e.g. save and load the files.

static add_gecko_simulation_results(dab_dto: CircuitDabDTO, get_waveforms: bool = False) CircuitDabDTO

Add GeckoCIRCUITS simulation results to the given DTO.

Parameters:
  • dab_dto – DabDTO

  • get_waveforms (bool) – Read back GeckoCIRCUITS simulation waveforms (high memory consumption). Default to False.

Returns:

DabDTO

static add_inductor_results(dab_dto: CircuitDabDTO, inductor_results: InductorResults) CircuitDabDTO

Add inductor results to the CircuitDabDTO.

Parameters:
  • dab_dto (d_dtos.CircuitDabDTO) – Dual-active bridge DTO

  • inductor_results (InductorResults) – inductor losses

Returns:

Dual-active bridge DTO including the inductor losses

Return type:

d_dtos.CircuitDabDTO

static add_stacked_transformer_results(dab_dto: CircuitDabDTO, transformer_results: StackedTransformerResults) CircuitDabDTO

Add stacked transformer results to the CircuitDabDTO.

Parameters:
  • dab_dto (d_dtos.CircuitDabDTO) – Dual-active bridge DTO

  • transformer_results (StackedTransformerResults) – stacked transformer results

Returns:

Dual-active bridge DTO including the inductor losses

Return type:

d_dtos.CircuitDabDTO

static calculate_from_configuration(config: CircuitConfig) CalcFromCircuitConfig

Calculate logical parameters which can be calculated from the input parameters.

Parameters:

config (CircuitConfig) – DAB configuration

Returns:

CalcFromConfig

Return type:

CalcFromCircuitConfig

static calculate_modulation(config: CircuitConfig, calc_config: CalcFromCircuitConfig) CalcModulation

Calculate the modulation parameters like phi, tau1, tau, …

Parameters:
  • config – DAB input configuration

  • calc_config – calculated parameters from the input configuration

Returns:

Modulation parameters.

static export_transformer_target_parameters_dto(dab_dto: CircuitDabDTO) TransformerTargetParameters

Export the optimization parameters for the transformer optimization (inside FEMMT).

Note: the current counting system is adapted to FEMMT! The secondary current is counted negative!

Parameters:

dab_dto (d_dtos.CircuitDabDTO) – DAB DTO

Returns:

DTO for the transformer optimization using FEMMT

Return type:

TransformerTargetParameters

static get_c_oss_from_tdb(transistor: Transistor, margin_factor: float = 1.2) tuple

Import the transistor Coss(Vds) capacitance from the transistor database (TDB).

Note we assume V_ds in Volt and C_oss in F. If this is not the case, scale your data accordingly!

Parameters:
  • transistor (transistordatabase.Transistor) – transistor database object

  • margin_factor (float) – factor for margin. [1.0 = no margin], [1.2 = 20 % margin: DEFAULT]

Returns:

c_oss, q_oss (in 1 V steps)

Return type:

tuple

static get_max_peak_waveform_inductor(dab_dto: CircuitDabDTO, plot: bool = False) tuple[ndarray, ndarray]

Get the inductor waveform with the maximum current peak out of the three-dimensional simulation array (v_1, v_2, P).

Parameters:
  • dab_dto (d_dtos.CircuitDabDTO) – DAB data transfer object (DTO)

  • plot (bool) – True to plot the results, mostly for understanding and debugging

Returns:

sorted_max_angles, i_l_s_max_current_waveform, i_l1_max_current_waveform. All as a numpy array.

Return type:

List[np.ndarray]

static get_max_peak_waveform_transformer(dab_dto: CircuitDabDTO, plot: bool = False) tuple[ndarray, ndarray, ndarray]

Get the transformer waveform with the maximum current peak out of the three-dimensional simulation array (v_1, v_2, P).

Parameters:
  • dab_dto (d_dtos.CircuitDabDTO) – DAB data transfer object (DTO)

  • plot (bool) – True to plot the results, mostly for understanding and debugging

Returns:

sorted_max_angles, i_l_s_max_current_waveform, i_hf_2_max_current_waveform. All as a numpy array.

Return type:

List[np.ndarray]

static init_config(name: str, v1_min: float, v1_max: float, v1_step: int, v2_min: float, v2_max: float, v2_step: int, p_min: float, p_max: float, p_step: int, n: float, ls: float, lc1: float, lc2: float, fs: float, transistor_dto_1: TransistorDTO, transistor_dto_2: TransistorDTO, c_par_1: float, c_par_2: float) CircuitDabDTO

Initialize the DAB structure.

Parameters:
  • name (str) – name of the simulation

  • v1_min (float) – V1 minimum voltage

  • v1_max (float) – V1 maximum voltage

  • v1_step (int) – V1 voltage steps

  • v2_min (float) – V2 minimum voltage

  • v2_max (float) – V2 maximum voltage

  • v2_step (int) – V2 voltage steps

  • p_min (float) – P minimum power

  • p_max (float) – P maximum power

  • p_step (int) – P power steps

  • n (float) – transformer transfer ratio

  • ls (float) – series inductance

  • lc1 (float) – Commutation inductance Lc1

  • lc2 (float) – Commutation inductance Lc2

  • fs (float) – Switching frequency

  • transistor_dto_1 (TransistorDTO) – Transistor DTO for transistor bridge 1. Must match with transistordatabase available transistors.

  • transistor_dto_2 (TransistorDTO) – Transistor DTO for transistor bridge 2. Must match with transistordatabase available transistors.

  • c_par_1 (float) – Parasitic PCB capacitance per transistor footprint of bridge 1

  • c_par_2 (float) – Parasitic PCB capacitance per transistor footprint of bridge 2

Returns:

static load_from_file(file: str) CircuitDabDTO

Load everything from the given .npz file.

Parameters:

file – a .nps filename or file-like object, string, or pathlib.Path

Returns:

two objects with type DAB_Specification and DAB_Results

static save(dab_dto: CircuitDabDTO, name: str, directory: str, timestamp: bool = True) None

Save the DabDTO-class to a npz file.

Parameters:
  • dab_dto (d_dtos.CircuitDabDTO) – Class to store

  • name (str) – Filename

  • directory (str) – Directory to store the results

  • timestamp (bool) – [True] to add a timestamp to the file name.

class dct.HandleTransistorDto

Bases: object

Handle the transistor DTOs.

static tdb_to_transistor_dto(transistor_name: str, c_oss_margin_factor: float = 1.2) TransistorDTO

Load a transistor from the transistor database and transfer the important parameters to a TransistorDTO.

Parameters:
  • transistor_name (str) – transistor name, must be same name as in the transistor database

  • c_oss_margin_factor (float) – margin for c_oss

Returns:

Transistor DTO

Return type:

d_dtosTransistorDTO

class dct.HeatSink(*, number_of_trials: int, calculation_mode: Literal['new', 'continue', 'skip'], subdirectory: str)

Bases: BaseModel

Flow control for the heat sink.

calculation_mode: Literal['new', 'continue', 'skip']
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

number_of_trials: int
subdirectory: str
class dct.HeatSinkBoundaryConditions(t_ambient: float, t_hs_max: float)

Bases: object

Fix parameters for the heat sink cooling.

t_ambient: float
t_hs_max: float
class dct.HeatSinkOptimization

Bases: object

Optimization support class for heat sink optimization.

generate_optimization_list(toml_heat_sink: TomlHeatSink, toml_prog_flow: FlowControl) bool

Initialize the configuration.

Parameters:
Returns:

True, if the configuration was successful initialized

Return type:

bool

optimization_config_list: list[OptimizationParameters]
optimization_handler(target_number_trials: int, debug: bool = False) None

Control the multi simulation processes.

Parameters:
  • target_number_trials (int) – Number of trials for the optimization

  • debug (bool) – Debug mode flag

class dct.InductiveElementCooling(tim_conductivity: float, tim_thickness: float)

Bases: object

Fix parameters for the inductive element cooling.

tim_conductivity: float
tim_thickness: float
class dct.Inductor(*, number_of_trials: int, calculation_mode: Literal['new', 'continue', 'skip'], subdirectory: str)

Bases: BaseModel

Flow control for the inductor.

calculation_mode: Literal['new', 'continue', 'skip']
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

number_of_trials: int
subdirectory: str
class dct.InductorOptimization

Bases: object

Optimization of the inductor.

generate_optimization_list(toml_inductor: TomlInductor, study_data: StudyData, filter_data: FilterData) bool

Initialize the configuration.

Parameters:
Returns:

True, if the configuration was successful initialized

Return type:

bool

optimization_config_list: list[InductorOptimizationDto]
optimization_handler(filter_data: FilterData, target_number_trials: int, factor_min_dc_losses: float = 1.0, factor_dc_max_losses: float = 100, enable_operating_range_simulation: bool = False, debug: bool = False) None

Control the multi simulation processes.

Parameters:
  • filter_data (dct.FilterData) – Information about the filtered designs

  • target_number_trials (int) – Number of trials for the optimization

  • factor_min_dc_losses (float) – Filter factor to use filter the results (ASA: Later to merge with toml-data filter factor)

  • factor_dc_max_losses (float) – Filter factor for the maximum losses, related to the minimum DC losses

  • enable_operating_range_simulation (bool) – True to perform the simulations for all operating points

  • debug (bool) – Debug mode flag

class dct.InductorOptimizationDto(circuit_id: int, inductor_optimization_dto: InductorOptimizationDTO)

Bases: object

DTO for the inductor optimization.

circuit_id: int
inductor_optimization_dto: InductorOptimizationDTO
class dct.InductorResults(**kwargs)

Bases: object

DTO contains the inductor losses.

area_to_heat_sink: float
circuit_trial_number: int
inductor_trial_number: int
p_combined_losses: ndarray
volume: float
class dct.ParetoFilePaths(circuit: str, inductor: str, transformer: str, heat_sink: str)

Bases: object

File paths for the sub simulation optimization parts.

circuit: str
heat_sink: str
inductor: str
transformer: str
class dct.ParetoPlots

Bases: object

Generate PDF plots to see the results of single Pareto steps (circuit, inductor, transformer, heat sink).

static generate_pdf_pareto(x_values_list: list, y_values_list: list, color_list: list, alpha: float, x_label: str, y_label: str, label_list: list[str | None], fig_name: str) None

Generate multiple Pareto plot in one PDF file.

Parameters:
  • x_values_list (list) – list of different Pareto plot x values

  • y_values_list (list) – list of different Pareto plot y values

  • color_list

  • alpha (float) – The alpha blending value, between 0 (transparent) and 1 (opaque).

  • x_label (str) – x label of the Pareto plot

  • y_label (str) – y label of the Pareto plot

  • label_list (list[str | None]) – list of different Pareto plot labels in a legend

  • fig_name (str) – filename, will be saved as pdf

static plot_circuit_results(toml_prog_flow: FlowControl) None

Plot the results of the circuit optimization in the Pareto plane.

Parameters:

toml_prog_flow (tc.FlowControl) – Flow control toml file

static plot_heat_sink_results(toml_prog_flow: FlowControl) None

Plot the results of the heat sink optimization in the Pareto plane.

Parameters:

toml_prog_flow (tc.FlowControl) – Flow control toml file

static plot_inductor_results(toml_prog_flow: FlowControl) None

Plot the results of the inductor optimization in the Pareto plane.

Parameters:

toml_prog_flow (tc.FlowControl) – Flow control toml file

static plot_summary(toml_prog_flow: FlowControl) None

Plot the combined results of circuit, inductor, transformer and heat sink in the Pareto plane.

Parameters:

toml_prog_flow (tc.FlowControl) – Flow control toml file

static plot_transformer_results(toml_prog_flow: FlowControl) None

Plot the results of the transformer optimization in the Pareto plane.

Parameters:

toml_prog_flow (tc.FlowControl) – Flow control toml file

static read_circuit_numbers_from_filestructure(toml_prog_flow: FlowControl) list[str]

Get the filtered circuit numbers from the “filtered_results” folder.

Parameters:

toml_prog_flow (tc.FlowControl) – Flow control toml file

Returns:

List with number of filtered circuit simulations

Return type:

list[int]

class dct.PlotDAB(is_latex: bool = False, window_title: str = 'DAB Plots', figsize: tuple = (12, 5), fontsize: int = 16, show: bool = True)

Bases: object

Class storing and managing the plot window, figs and axes.

apply_spacings(fig)

Set default spacings for the plots.

Parameters:

fig (matplotlib.plot.figure) – matplotlib figure

close()

Close plot window.

figs_axes: list
new_fig(nrows: int = 1, ncols: int = 1, sharex: bool = True, sharey: bool = True, tab_title: str = 'add Plot title') None

Create a new fig in a new tab with the amount of subplots specified.

Parameters:
  • nrows (int) – number of figures in a row

  • ncols (int) – number of figures in a column

  • sharex (int) – 1 to share the x-axis between the figures

  • sharey (int) – 1 to share the y-axis between the figures

  • tab_title (str) – Set the title of the tab-selector

plot_3by1(fig_axes: tuple, x: ndarray, y: ndarray, z1: ndarray, z2: ndarray, z3: ndarray, xl: str = 'x', yl: str = 'y', t1: str = 'z1', t2: str = 'z2', t3: str = 'z3') None

Plot three contourf plots with a shared colorbar.

Parameters:
  • fig_axes (tuple) – Provide the tuple (fig, axs)

  • x (np.ndarray) – x mesh, e.g. P

  • y (np.ndarray) – y mesh, e.g. V2

  • z1 (np.ndarray) – z for subplot 1, e.g. phi

  • z2 (np.ndarray) – z for subplot 2, e.g. tau1

  • z3 (np.ndarray) – z for subplot 3, e.g. tau2

  • t1 (str) – title for plot 1

  • t2 (str) – title for plot 2

  • t3 (str) – title for plot 3

  • xl (str) – x label

  • yl (str) – y label

plot_modulation(x: ndarray, y: ndarray, z1: ndarray, z2: ndarray, z3: ndarray, title: str = '', mask1: ndarray | None = None, mask2: ndarray | None = None, mask3: ndarray | None = None, maskZVS: ndarray | None = None, Vnum: float = 2, tab_title: str = 'add Plot title') None

Plot three contourf plots with a shared colorbar.

Parameters:
  • x (np.ndarray) – x mesh, e.g. P

  • y (np.ndarray) – y mesh, e.g. V2

  • z1 (np.ndarray) – z for subplot 1, e.g. phi

  • z2 (np.ndarray) – z for subplot 2, e.g. tau1

  • z3 (np.ndarray) – z for subplot 3, e.g. tau2

  • mask1 (np.ndarray) – optional mask contour line

  • mask2 (np.ndarray) – optional mask contour line

  • mask3 (np.ndarray) – optional mask contour line

  • Vnum (int) – Voltage number of y-axis {1, 2}

  • tab_title (str) – Set the title of the tab-selector

  • maskZVS (np.ndarray) – mask for ZVS

  • title (str) – title of plot

plot_modulation_classic(fig_axes: tuple, x: ndarray, y: ndarray, z1: ndarray, z2: ndarray, z3: ndarray, title: str = '', mask1: ndarray | None = None, mask2: ndarray | None = None, mask3: ndarray | None = None, maskZVS: ndarray | None = None) None

Plot three contourf plots with a shared colorbar.

Parameters:
  • fig_axes (tuple) – Provide the tuple (fig, axs)

  • x (np.ndarray) – x mesh, e.g. P

  • y (np.ndarray) – y mesh, e.g. V2

  • z1 (np.ndarray) – z for subplot 1, e.g. phi

  • z2 (np.ndarray) – z for subplot 2, e.g. tau1

  • z3 (np.ndarray) – z for subplot 3, e.g. tau2

  • mask1 (np.ndarray) – optional mask contour line

  • mask2 (np.ndarray) – optional mask contour line

  • mask3 (np.ndarray) – optional mask contour line

  • title (str) – title of plot

  • maskZVS (np.ndarray) – mask for ZVS

plot_rms_current(mesh_V2: ndarray, mesh_P: ndarray, mvvp_iLs: ndarray) Figure

Plot RMS currents.

Parameters:
  • mesh_V2 (np.ndarray) – mesh of voltage v2 in V

  • mesh_P (np.ndarray) – mesh of the power P in W

  • mvvp_iLs (np.ndarray) – current i_Ls in A

pw: PlotWindow
save_fig(fig: Figure, directory: str | None = None, name: str = '', comment: str = '', timestamp: bool = True) None

Save the given fig as PNG and PDF.

Parameters:
  • fig (matplotlib.pyplot.figure) – matplotlib figure

  • directory (str) – Directory to store the figure

  • name (str) – Name of the figure

  • comment (str) – Comment

  • timestamp (bool) – If the filename should start with a timestamp

show()

Show the plots all at once.

subplot(x: ndarray, y: ndarray, ax: Axes | None = None, xlabel: str = 'x', ylabel: str = 'y', title: str = '', xscale: str = 'linear', yscale: str = 'linear') None

Plot a simple line plot in a subplot.

Parameters:
  • x (np.ndarray)

  • y (np.ndarray)

  • ax (str) – axis

  • xlabel (str) – x label

  • ylabel (str) – y label

  • title (str) – title

  • xscale (str) – {“linear”, “log”, “symlog”, “logit”, …}

  • yscale (str) – {“linear”, “log”, “symlog”, “logit”, …}

subplot_contourf(x: ndarray, y: ndarray, z: ndarray, mask1: ndarray | None = None, mask2: ndarray | None = None, mask3: ndarray | None = None, nan_matrix: ndarray | None = None, ax: Axes | None = None, num_cont_lines: int = 12, alpha: float = 0.75, cmap: str = 'viridis', axlinewidth: float = 0.5, axlinecolor: str = 'r', wp_x: float | None = None, wp_y: float | None = None, inlinespacing: int = -10, xlabel: str = '', ylabel: str = '', title: str = '', clabel: bool = False, markerstyle: str = 'star', z_min: float | None = None, z_max: float | None = None, square: bool = False, same_xy_ticks: bool = False) None

Draw a subplot contourf.

The area of z where a nan can be found in nan_matrix will be shaded.

Parameters:
  • x (np.ndarray) – x-coordinate

  • y (np.ndarray) – y-coordinate

  • z (np.ndarray) – z-coordinate

  • nan_matrix (np.ndarray) – [optional] z-values where a nan is in nan_matrix will be plotted shaded

  • ax (str) – choose the axis to draw this plot

  • num_cont_lines (int) – [optional] number of contour lines, default to 20

  • alpha (float) – [optional] shading 0…1. 1 = 100%, default to 0.5

  • cmap (str) – [optional] cmap type, e.g. inferno

  • axlinewidth (float) – [optional] line width of axvline and axhline, default to 0.5

  • axlinecolor (str) – [optional] color of axline and star, default to red

  • wp_x (float) – [optional] working point in x (for marker line or star marker)

  • wp_y (float) – [optional] working point in y (for marker line or star marker)

  • inlinespacing (float) – [optional] default to -10

  • xlabel (str) – [optional] x-label

  • ylabel (str) – [optional] y-label

  • title (str) – [optional] subplot figure title

  • clabel (str) – [optional] True to write labels inside the plot, default to False

  • markerstyle (str) – [optional] marker style: ‘star’ or ‘line’

  • z_min (float) – [optional] clip to minimum z-value

  • z_max (float) – [optional] clip to maximum z-value

  • mask1 (np.ndarray) – optional mask contour line

  • mask2 (np.ndarray) – optional mask contour line

  • mask3 (np.ndarray) – optional mask contour line

  • square (bool)

  • same_xy_ticks (bool)

subplot_contourf_fixedz(x: ndarray, y: ndarray, z: ndarray, mask1: ndarray | None = None, mask2: ndarray | None = None, mask3: ndarray | None = None, nan_matrix: ndarray | None = None, ax: Axes | None = None, num_cont_lines: int = 12, alpha: float = 0.75, cmap: str = 'viridis', axlinewidth: float = 0.5, axlinecolor: str = 'r', wp_x: float | None = None, wp_y: float | None = None, inlinespacing: int = -10, xlabel: str = '', ylabel: str = '', title: str = '', clabel: bool = False, markerstyle: str = 'star', z_min: float | None = None, z_max: float | None = None) None

Draw a subplot contourf.

The area of z where a nan can be found in nan_matrix will be shaded.

Parameters:
  • x (np.ndarray) – x-coordinate

  • y (np.ndarray) – y-coordinate

  • z (np.ndarray) – z-coordinate

  • nan_matrix (np.ndarray) – [optional] z-values where a nan is in nan_matrix will be plotted shaded

  • ax (str) – choose the axis to draw this plot

  • num_cont_lines (int) – [optional] number of contour lines, default to 20

  • alpha (float) – [optional] shading 0…1. 1 = 100%, default to 0.5

  • cmap (str) – [optional] cmap type, e.g. inferno

  • axlinewidth (float) – [optional] line width of axvline and axhline, default to 0.5

  • axlinecolor (str) – [optional] color of axline and star, default to red

  • wp_x (float) – [optional] working point in x (for marker line or star marker)

  • wp_y (float) – [optional] working point in y (for marker line or star marker)

  • inlinespacing (float) – [optional] default to -10

  • xlabel (str) – [optional] x-label

  • ylabel (str) – [optional] y-label

  • title (str) – [optional] subplot figure title

  • clabel (str) – [optional] True to write labels inside the plot, default to False

  • markerstyle (str) – [optional] marker style: ‘star’ or ‘line’

  • z_min (float) – [optional] clip to minimum z-value

  • z_max (float) – [optional] clip to maximum z-value

  • mask1 (np.ndarray) – optional mask contour line

  • mask2 (np.ndarray) – optional mask contour line

  • mask3 (np.ndarray) – optional mask contour line

subplot_contourf_nan(x: ndarray, y: ndarray, z: ndarray, nan_matrix: ndarray | None = None, ax: Axes | None = None, num_cont_lines: int = 20, alpha: float = 0.75, cmap: str = 'inferno', axlinewidth: float = 0.5, axlinecolor: str = 'r', wp_x: float | None = None, wp_y: float | None = None, inlinespacing: int = -10, xlabel: str = 'Lambda = f * L', ylabel: str = 'Turns ratio n', fontsize_axis: int = 9, fontsize_title: int = 9, title: str = '', clabel: bool = False, markerstyle: str = 'star', z_min: float | None = None, z_max: float | None = None) None

Draw a subplot contourf.

The area of z where a nan can be found in nan_matrix will be shaded.

Parameters:
  • x (np.ndarray) – x-coordinate

  • y (np.ndarray) – y-coordinate

  • z (np.ndarray) – z-coordinate

  • nan_matrix (np.ndarray) – [optional] z-values where a nan is in nan_matrix will be plotted shaded

  • ax (str) – choose the axis to draw this plot

  • num_cont_lines (int) – [optional] number of contour lines, default to 20

  • alpha (float) – [optional] shading 0…1. 1 = 100%, default to 0.5

  • cmap (str) – [optional] cmap type, e.g. inferno

  • axlinewidth (float) – [optional] line width of axvline and axhline, default to 0.5

  • axlinecolor (str) – [optional] color of axline and star, default to red

  • wp_x (float) – [optional] working point in x (for marker line or star marker)

  • wp_y (float) – [optional] working point in y (for marker line or star marker)

  • inlinespacing (float) – [optional] default to -10

  • xlabel (str) – [optional] x-label

  • ylabel (str) – [optional] y-label

  • fontsize_axis (float) – [optional] default to 9

  • fontsize_title (float) – [optional] default to 9

  • title (str) – [optional] subplot figure title

  • clabel (str) – [optional] True to write labels inside the plot, default to False

  • markerstyle (str) – [optional] marker style: ‘star’ or ‘line’

  • z_min (float) – [optional] clip to minimum z-value

  • z_max (float) – [optional] clip to maximum z-value

class dct.PlotWindow(parent: None = None, window_title: str = 'plot window', figsize: tuple = (12.8, 8))

Bases: object

Class to initialize the GUI.

add_plot(title: str, figure: Figure) None

Add plot to the GUI instance.

Parameters:
  • title (str) – title for the plot

  • figure (matplotlib.Figure) – Figure to add the plot

close()

Close the GUI application.

show()

Show the GUI application.

class dct.StackedTransformerResults(**kwargs)

Bases: object

DTO contains the stacked transformer losses.

area_to_heat_sink: float
circuit_trial_number: int
p_combined_losses: ndarray
stacked_transformer_trial_number: int
volume: float
class dct.StudyData(study_name: str, optimization_directory: str)

Bases: object

Data class containing all general information to perform a study.

optimization_directory: str
study_name: str
class dct.Summary(*, calculation_mode: Literal['new', 'skip'], subdirectory: str)

Bases: BaseModel

Flow control for the summary.

calculation_mode: Literal['new', 'skip']
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

subdirectory: str
class dct.ThermalCalcSupport

Bases: object

Provides functions to calculate the thermal resistance.

static calculate_r_th_copper_coin(cooling_area: float, height_pcb: float = 0.00155, height_pcb_heat_sink: float = 0.003) tuple[float, float]

Calculate the thermal resistance of the copper coin.

Assumptions are made with some geometry factors from a real copper coin for TO263 housing. :param cooling_area: cooling area in m² :type cooling_area: float :param height_pcb: PCB thickness, e.g. 1.55 mm :type height_pcb: float :param height_pcb_heat_sink: Distance from PCB to heat sink in m :type height_pcb_heat_sink: float :return: r_th_copper_coin, effective_copper_coin_cooling_area :rtype: tuple[float, float]

static calculate_r_th_tim(copper_coin_bot_area: float, transistor_cooling: TransistorCooling) float

Calculate the thermal resistance of the thermal interface material (TIM).

Parameters:
  • copper_coin_bot_area (float) – bottom copper coin area in m²

  • transistor_cooling (TransistorCooling) – Transistor cooling DTO

Returns:

r_th of TIM material

Return type:

float

class dct.TomlCircuitFilterDistance(*, number_filtered_designs: int, difference_percentage: float)

Bases: BaseModel

Toml checker class for CircuitFilterDistance.

difference_percentage: float
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

number_filtered_designs: int
class dct.TomlCircuitOutputRange(*, v_1_min_max_list: list, v_2_min_max_list: list, p_min_max_list: list, steps_per_direction: int)

Bases: BaseModel

Definition of the DAB operating area.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

p_min_max_list: list
steps_per_direction: int
v_1_min_max_list: list
v_2_min_max_list: list
class dct.TomlCircuitParetoDabDesign(*, design_space: TomlCircuitParetoDesignSpace, output_range: TomlCircuitOutputRange, filter_distance: TomlCircuitFilterDistance)

Bases: BaseModel

Config to optimize the Dual-Active Bridge (DAB) converter.

design_space: TomlCircuitParetoDesignSpace
filter_distance: TomlCircuitFilterDistance
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

output_range: TomlCircuitOutputRange
class dct.TomlCircuitParetoDesignSpace(*, f_s_min_max_list: list, l_s_min_max_list: list, l_1_min_max_list: list, l_2__min_max_list: list, n_min_max_list: list, transistor_1_name_list: list[str], transistor_2_name_list: list[str], c_par_1: float, c_par_2: float)

Bases: BaseModel

Definition of the hardware design space for electronic components.

c_par_1: float
c_par_2: float
f_s_min_max_list: list
l_1_min_max_list: list
l_2__min_max_list: list
l_s_min_max_list: list
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

n_min_max_list: list
transistor_1_name_list: list[str]
transistor_2_name_list: list[str]
class dct.TomlFilterDistance(*, factor_min_dc_losses: float, factor_max_dc_losses: float)

Bases: BaseModel

Toml checker class for FilterDistance.

factor_max_dc_losses: float
factor_min_dc_losses: float
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class dct.TomlHeatSink(*, design_space: TomlHeatSinkDesignSpace, settings: TomlHeatSinkSettings, boundary_conditions: TomlHeatSinkBoundaryConditions, thermal_resistance_data: TomlHeatSinkSummaryData)

Bases: BaseModel

Toml checker for HeatSink.

boundary_conditions: TomlHeatSinkBoundaryConditions
design_space: TomlHeatSinkDesignSpace
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

settings: TomlHeatSinkSettings
thermal_resistance_data: TomlHeatSinkSummaryData
class dct.TomlHeatSinkBoundaryConditions(*, t_ambient: float, area_min: float)

Bases: BaseModel

Toml checker for HeatSinkBoundaryConditions.

area_min: float
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

t_ambient: float
class dct.TomlHeatSinkDesignSpace(*, height_c_list: list[float], width_b_list: list[float], length_l_list: list[float], height_d_list: list[float], number_fins_n_list: list[int], thickness_fin_t_list: list[float])

Bases: BaseModel

Toml checker for HeatSinkDesignSpace.

height_c_list: list[float]
height_d_list: list[float]
length_l_list: list[float]
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

number_fins_n_list: list[int]
thickness_fin_t_list: list[float]
width_b_list: list[float]
class dct.TomlHeatSinkSettings(*, number_directions: int, factor_pcb_area_copper_coin: float, factor_bottom_area_copper_coin: float, thermal_conductivity_copper: float)

Bases: BaseModel

Toml checker for HeatSinkSettings.

factor_bottom_area_copper_coin: float
factor_pcb_area_copper_coin: float
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

number_directions: int
thermal_conductivity_copper: float
class dct.TomlHeatSinkSummaryData(*, transistor_b1_cooling: list[float], transistor_b2_cooling: list[float], inductor_cooling: list[float], transformer_cooling: list[float], heat_sink: list[float])

Bases: BaseModel

Toml checker for HeatSinkSummaryData.

heat_sink: list[float]
inductor_cooling: list[float]
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

transformer_cooling: list[float]
transistor_b1_cooling: list[float]
transistor_b2_cooling: list[float]
class dct.TomlInductor(*, design_space: TomlInductorDesignSpace, insulations: TomlInductorInsulation, boundary_conditions: TomlInductorBoundaryConditions, filter_distance: TomlFilterDistance, material_data_sources: TomlMaterialDataSources)

Bases: BaseModel

Toml checker class for Inductor.

boundary_conditions: TomlInductorBoundaryConditions
design_space: TomlInductorDesignSpace
filter_distance: TomlFilterDistance
insulations: TomlInductorInsulation
material_data_sources: TomlMaterialDataSources
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class dct.TomlInductorBoundaryConditions(*, temperature: float)

Bases: BaseModel

Toml checker class for InductorBoundaryConditions.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

temperature: float
class dct.TomlInductorDesignSpace(*, core_name_list: list[str], material_name_list: list[str], litz_wire_list: list[str], core_inner_diameter_list: list[float], window_h_list: list[float], window_w_list: list[float])

Bases: BaseModel

Toml checker class for InductorDesignSpace.

core_inner_diameter_list: list[float]
core_name_list: list[str]
litz_wire_list: list[str]
material_name_list: list[str]
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

window_h_list: list[float]
window_w_list: list[float]
class dct.TomlInductorInsulation(*, primary_to_primary: float, core_bot: float, core_top: float, core_right: float, core_left: float)

Bases: BaseModel

Toml checker class for InductorInsulation.

core_bot: float
core_left: float
core_right: float
core_top: float
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

primary_to_primary: float
class dct.TomlMaterialDataSources(*, permeability_datasource: str, permeability_datatype: str, permeability_measurement_setup: str, permittivity_datasource: str, permittivity_datatype: str, permittivity_measurement_setup: str)

Bases: BaseModel

Toml checker class for MaterialDataSources.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

permeability_datasource: str
permeability_datatype: str
permeability_measurement_setup: str
permittivity_datasource: str
permittivity_datatype: str
permittivity_measurement_setup: str
class dct.TomlTransformer(*, design_space: TomlTransformerDesignSpace, insulation: TomlTransformerInsulation, filter_distance: TomlTransformerFilterDistance, settings: TomlTransformerSettings, boundary_conditions: TomlTransformerBoundaryConditions)

Bases: BaseModel

Toml checker class for Transformer.

boundary_conditions: TomlTransformerBoundaryConditions
design_space: TomlTransformerDesignSpace
filter_distance: TomlTransformerFilterDistance
insulation: TomlTransformerInsulation
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

settings: TomlTransformerSettings
class dct.TomlTransformerBoundaryConditions(*, max_transformer_total_height: float, max_core_volume: float, temperature: float)

Bases: BaseModel

Toml checker class for TransformerBoundaryConditions.

max_core_volume: float
max_transformer_total_height: float
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

temperature: float
class dct.TomlTransformerDesignSpace(*, material_name_list: list[str], core_name_list: list[str], core_inner_diameter_min_max_list: list[float], window_w_min_max_list: list[float], window_h_bot_min_max_list: list[float], primary_litz_wire_list: list[str], secondary_litz_wire_list: list[str], n_p_top_min_max_list: list[int], n_p_bot_min_max_list: list[int])

Bases: BaseModel

Toml checker class for TransformerDesignSpace.

core_inner_diameter_min_max_list: list[float]
core_name_list: list[str]
material_name_list: list[str]
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

n_p_bot_min_max_list: list[int]
n_p_top_min_max_list: list[int]
primary_litz_wire_list: list[str]
secondary_litz_wire_list: list[str]
window_h_bot_min_max_list: list[float]
window_w_min_max_list: list[float]
class dct.TomlTransformerFilterDistance(*, factor_min_dc_losses: float, factor_max_dc_losses: float)

Bases: BaseModel

Toml checker class for TransformerFilterDistance.

factor_max_dc_losses: float
factor_min_dc_losses: float
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class dct.TomlTransformerInsulation(*, iso_window_top_core_top: float, iso_window_top_core_bot: float, iso_window_top_core_left: float, iso_window_top_core_right: float, iso_window_bot_core_top: float, iso_window_bot_core_bot: float, iso_window_bot_core_left: float, iso_window_bot_core_right: float, iso_primary_to_primary: float, iso_secondary_to_secondary: float, iso_primary_to_secondary: float)

Bases: BaseModel

Toml checker class for TransformerInsulation.

iso_primary_to_primary: float
iso_primary_to_secondary: float
iso_secondary_to_secondary: float
iso_window_bot_core_bot: float
iso_window_bot_core_left: float
iso_window_bot_core_right: float
iso_window_bot_core_top: float
iso_window_top_core_bot: float
iso_window_top_core_left: float
iso_window_top_core_right: float
iso_window_top_core_top: float
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class dct.TomlTransformerSettings(*, fft_filter_value_factor: float, mesh_accuracy: float)

Bases: BaseModel

Toml checker class for TransformerSettings.

fft_filter_value_factor: float
mesh_accuracy: float
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class dct.Transformer(*, number_of_trials: int, calculation_mode: Literal['new', 'continue', 'skip'], subdirectory: str)

Bases: BaseModel

Flow control for the transformer.

calculation_mode: Literal['new', 'continue', 'skip']
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

number_of_trials: int
subdirectory: str
class dct.TransformerOptimization

Bases: object

Optimization of the transformer.

generate_optimization_list(toml_transformer: TomlTransformer, study_data: StudyData, filter_data: FilterData) bool

Initialize the configuration.

Parameters:
Returns:

True, if the configuration was successful initialized

Return type:

bool

optimization_config_list: list[TransformerOptimizationDto]
simulation_handler(filter_data: FilterData, target_number_trials: int, factor_dc_min_losses: float = 1.0, factor_dc_max_losses: float = 100, enable_operating_range_simulation: bool = False, debug: bool = False) None

Control the multi simulation processes.

:param filter_data : Information about the filtered circuit designs :type filter_data : dct.FilterData :param target_number_trials: Number of trials for the optimization :type target_number_trials: int :param factor_dc_min_losses: Filter factor for the offset, related to the minimum DC losses :type factor_dc_min_losses: float :param factor_dc_max_losses: Filter factor for the maximum losses, related to the minimum DC losses :type factor_dc_max_losses: float :param enable_operating_range_simulation: True to perform the simulations for all operating points :type enable_operating_range_simulation: bool :param debug: Debug mode flag :type debug: bool

class dct.TransformerOptimizationDto(circuit_id: int, transformer_optimization_dto: StoSingleInputConfig)

Bases: object

DTO for the transformer optimization.

circuit_id: int
transformer_optimization_dto: StoSingleInputConfig
class dct.TransformerTargetParameters(l_s12_target: float, l_h_target: float, n_target: float, time_current_1_vec: ndarray, time_current_2_vec: ndarray, temperature: float)

Bases: object

Target transformer parameters for the optimization.

l_h_target: float
l_s12_target: float
n_target: float
temperature: float
time_current_1_vec: ndarray
time_current_2_vec: ndarray
class dct.TransistorCooling(tim_conductivity: float, tim_thickness: float)

Bases: object

Fix parameters for the transistor cooling.

tim_conductivity: float
tim_thickness: float
class dct.TransistorDTO(name: str, t_j_max_op: ndarray, c_oss: ndarray, q_oss: ndarray, housing_area: float64, cooling_area: float64, r_th_jc: ndarray, r_channel: ndarray)

Bases: object

Contains constant transistor information.

c_oss: ndarray
cooling_area: float64
housing_area: float64
name: str
q_oss: ndarray
r_channel: ndarray
r_th_jc: ndarray
t_j_max_op: ndarray
dct.calc_hf_currents(angles_sorted: ndarray, i_l_s_sorted: ndarray, i_l_1_sorted: ndarray, i_l_2_sorted: ndarray, n: float64) tuple

Calculate i_hf_1_rms and i_hf_2_rms from i_l_s, i_l_1 and i_l_2.

Parameters:
  • angles_sorted (np.ndarray) – sorted angles

  • i_l_s_sorted (np.ndarray) – sorted currents i_l_s

  • i_l_1_sorted (np.ndarray) – sorted currents i_l_1

  • i_l_2_sorted (np.ndarray) – sorted currents i_l_2

  • n (np.ndarray) – transfer ratio

Returns:

(i_hf_1_rms, i_hf_2_rms, i_hf_1_sorted, i_hf_2_sorted)

Return type:

tuple

dct.calc_modulation_params(n: float, ls: float, lc1: float, lc2: float, fs: ndarray | int | float, c_oss_1: ndarray, c_oss_2: ndarray, v1: ndarray, v2: ndarray, power: ndarray) dict

OptZVS (Optimal ZVS) Modulation calculation, which will return phi, tau1 and tau2.

Parameters:
  • n (float) – Transformer turns ratio n1/n2.

  • ls (float) – DAB converter series inductance. (Must not be zero!)

  • lc1 (float) – Side 1 commutation inductance. Use np.inf it not present.

  • lc2 (float) – Side 2 commutation inductance. Use np.inf it not present. (Must not be zero!)

  • fs (float) – Switching frequency, can be a fixed value or a meshgrid with same shape as the other meshes.

  • c_oss_1 (np.array) – Side 1 MOSFET Coss(Vds) curve from Vds=0V to >= V1_max. Just one row with Coss data and index = Vds.

  • c_oss_2 (np.array) – Side 2 MOSFET Coss(Vds) curve from Vds=0V to >= V2_max. Just one row with Coss data and index = Vds.

  • v1 (np.array) – Input voltage meshgrid (voltage on side 1).

  • v2 (np.array) – Output voltage meshgrid (voltage on side 2).

  • power (np.array) – DAB input power meshgrid (P=V1*I1).

Returns:

dict with phi, tau1, tau2, masks (phi has First-Falling-Edge alignment!)

dct.calc_rms(alpha_rad: ndarray, beta_rad: ndarray, gamma_rad: ndarray, delta_rad: ndarray, i_alpha: ndarray, i_beta: ndarray, i_gamma: ndarray, i_delta: ndarray) tuple[object, ndarray, ndarray]

Calculate a single RMS current for some single points, with a linear current between them.

Angles alpha to delta according to “closed-form solution for efficient ZVS modulation of DAB converters”. Function works with multidimensional arrays.

Interval is symmetric by pi. Starts from zero, ends with pi. Some angles will be higher than pi, needs to be mirrored to values smaller than pi.

Everything must be numpy!

Parameters:
  • alpha_rad (np.ndarray) – angle alpha in rad

  • beta_rad (np.ndarray) – angle beta in rad

  • gamma_rad (np.ndarray) – angle gamma in rad

  • delta_rad (np.ndarray) – angle delta in rad

  • i_alpha (np.ndarray) – current at angle alpha

  • i_beta (np.ndarray) – current at angle beta

  • i_gamma (np.ndarray) – current at angle gamma

  • i_delta (np.ndarray) – current at angle delta

Returns:

rms current

dct.calc_rms_currents(config: CircuitConfig, calc_from_config: CalcFromCircuitConfig, calc_modulation: CalcModulation) tuple

Calculate the RMS currents in l_s, l_1 and l_2 for the given input values.

Works with 2- and 3-dimensional input arrays (2D e.g. v_2 and power, 3D e.g. v_1, v_2 and power) everything must be numpy!

Parameters:
  • config – design configuration DTO

  • calc_from_config – Additional input parameters calculated once from the input configuration

  • calc_modulation – Calculated modulation parameters DTO

Returns:

i_l_s_rms, i_l_1_rms, i_l_2_rms, angles_sorted, i_l_s_sorted, i_l_1_sorted, i_l_2_sorted, angles_unsorted

Return type:

tuple

dct.calc_transistor_rms_currents(i_hf_rms: float) float

Calculate the transistor RMS currents from the i_HF currents (bridge 1 or bridge 2).

Parameters:

i_hf_rms (float) – bridge 1 or bridge 2 RMS current

Returns:

bridge 1 or bridge 2 transistor RMS current

Return type:

float

dct.calculate_r_th_copper_coin(cooling_area: float, height_pcb: float = 0.00155, height_pcb_heat_sink: float = 0.003) tuple[float, float]

Calculate the thermal resistance of the copper coin.

Assumptions are made with some geometry factors from a real copper coin for TO263 housing. :param cooling_area: cooling area in m² :type cooling_area: float :param height_pcb: PCB thickness, e.g. 1.55 mm :type height_pcb: float :param height_pcb_heat_sink: Distance from PCB to heat sink in m :type height_pcb_heat_sink: float :return: r_th_copper_coin, effective_copper_coin_cooling_area :rtype: tuple[float, float]

dct.calculate_r_th_tim(copper_coin_bot_area: float, transistor_cooling: TransistorCooling) float

Calculate the thermal resistance of the thermal interface material (TIM).

Parameters:
  • copper_coin_bot_area (float) – bottom copper coin area in m²

  • transistor_cooling (TransistorCooling) – Transistor cooling DTO

Returns:

r_th of TIM material

Return type:

float

dct.check_for_missing_toml_files(working_directory: str) None

Check for missing toml default files. Generate them, if missing.

Parameters:

working_directory (str) – working directory

dct.colors() dict

Colors according to the GNOME color scheme (Color 4).

dct.full_angle_waveform_from_angles(sorted_angles: ndarray) ndarray

Generate the full 2pi-periodic angle waveform from the four sorted angles [alpha, beta, gamma, delta].

Parameters:

sorted_angles (np.ndarray) – [alpha, beta, gamma, delta], but in sorted order

Returns:

2pi-periodic angles for a full waveform

Return type:

np.ndarray

dct.full_current_waveform_from_currents(sorted_currents: ndarray) ndarray

Generate the full 2pi-periodic current waveform from the four current values [i_alpha, i_beta, i_gamma, i_delta].

Parameters:

sorted_currents (np.ndarray) – [i_alpha, i_beta, i_gamma, i_delta], but sorted

Returns:

2pi-periodic current waveform

Return type:

np.ndarray

dct.full_waveforms_from_angles_currents(angles_rad_sorted: ndarray, *sorted_currents: ndarray) tuple[ndarray]

Generate the full 2pi-periodic time and current waveform from the four time and current values at [alpha, beta, gamma, delta].

Multiple current inputs possible. Sorts out same time values, e.g [0, 2, 3.14, 3,14] -> [0, 2, 3.14]

Parameters:
  • angles_rad_sorted (np.ndarray) – [alpha, beta, gamma, delta], but in sorted order. Unit is radiant.

  • sorted_currents (np.ndarray) – [i_alpha, i_beta, i_gamma, i_delta], but sorted

Returns:

2pi-periodic time and current waveforms

Return type:

np.ndarray

dct.generate_circuit_toml(working_directory: str) None

Generate the default DabCircuitConf.toml file.

Parameters:

working_directory (str) – working directory

dct.generate_flow_control_toml(working_directory: str) None

Generate the default progFlow.toml file.

Parameters:

working_directory (str) – working directory

dct.generate_heat_sink_toml(working_directory: str) None

Generate the default DabHeatSinkConf.toml file.

Parameters:

working_directory (str) – working directory

dct.generate_inductor_toml(working_directory: str) None

Generate the default DabInductorConf.toml file.

Parameters:

working_directory (str) – working directory

dct.generate_logging_config(working_directory: str) None

Generate the default logging configuration file.

Parameters:

working_directory (str) – working directory

dct.generate_transformer_toml(working_directory: str) None

Generate the default DabTransformerConf.toml file.

Parameters:

working_directory (str) – working directory

dct.get_free_port(start: int = 43047, stop: int = 50000) int

Get a random free port in Range start <= port < stop.

Parameters:
  • start (int) – start port

  • stop (int) – stop port

Returns:

dct.global_plot_settings_font_latex() None

Set the plot fonts to LaTeX-font.

dct.global_plot_settings_font_sansserif() None

Set the plot fonts to Sans-Serif-Font.

dct.plot_calc_i_hf_waveforms(dab_dto: CircuitDabDTO, compare_gecko_waveforms: bool = False) None

Plot calculated current waveforms for i_hf_1 and i_hf_2.

Parameters:
  • dab_dto (CircuitDabDTO) – DAB DTO

  • compare_gecko_waveforms (bool) – True to compare calculation with simulated waveforms (GeckoCIRCUITS)

dct.plot_calc_waveforms(dab_dto: CircuitDabDTO, compare_gecko_waveforms: bool = False) None

Plot calculated current waveforms for Ls, Lc1, Lc2.

Parameters:
  • dab_dto (CircuitDabDTO) – DAB DTO

  • compare_gecko_waveforms (bool) – True to compare calculation with simulated waveforms (GeckoCIRCUITS)

dct.plot_calculation_results(dab_config: CircuitDabDTO) None

Calculate the DAB operating points and show the results.

Parameters:

dab_config (CircuitDabDTO) – DAB configuration file

dct.plot_gecko_simulation_results(dab_config: CircuitDabDTO, simulation_name: str, comment: str, directory: str, show_plot: bool = True) None

Plot the results from the GeckoCIRCUITS simulation.

Parameters:
  • dab_config (CircuitDabDTO) – Dual-Active-Bridge (DAB) configuration file

  • simulation_name (str) – Simulation name

  • comment (str) – Comment for the simulation, appears in the logs.

  • directory (str) – Directory to plot

  • show_plot (bool) – True (default) to show the plots.

dct.plot_mode_overview(dab_config: CircuitDabDTO) None

Mode overview of the converter. This function is for debugging.

Parameters:

dab_config (dct.CircuitDabDTO) – DAB configuration file

dct.plot_modulation(x: ndarray, y: ndarray, z1: ndarray, z2: ndarray, z3: ndarray, title: str = '', mask1: ndarray | None = None, mask2: ndarray | None = None, mask3: ndarray | None = None, maskZVS: ndarray | None = None, Vnum: int = 2, filename: str = 'Plot_title', latex: bool = False) None

Plot three contourf plots with a shared colorbar.

Parameters:
  • x (np.ndarray) – x mesh, e.g. P

  • y (np.ndarray) – y mesh, e.g. V2

  • z1 (np.ndarray) – z for subplot 1, e.g. phi

  • z2 (np.ndarray) – z for subplot 2, e.g. tau1

  • z3 (np.ndarray) – z for subplot 3, e.g. tau2

  • mask1 (np.ndarray) – optional mask contour line

  • mask2 (np.ndarray) – optional mask contour line

  • mask3 (np.ndarray) – optional mask contour line

  • Vnum (int) – Voltage number of y-axis {1, 2}

  • maskZVS (np.ndarray) – ZVS mask

  • Vnum

  • filename (str) – name of the file

  • latex (bool) – True to set font to LaTeX font

  • title (str) – title of the plot

dct.plot_rms_current(mesh_v2: ndarray, mesh_p: ndarray, mvvp_i_ls: ndarray) Figure

Plot the RMS currents.

Parameters:
  • mesh_v2 (np.ndarray) – mesh of voltage v2 in V

  • mesh_p (np.ndarray) – mesh of the power P in W

  • mvvp_i_ls (np.ndarray) – current i_Ls in A

dct.show_plot()

Show the plots all at once.

dct.start_gecko_simulation(mesh_v1: ndarray, mesh_v2: ndarray, mesh_p: ndarray, mod_phi: ndarray, mod_tau1: ndarray, mod_tau2: ndarray, t_dead1: float | ndarray, t_dead2: float | ndarray, fs: int | ndarray | float64, ls: float, lc1: float, lc2: float, n: float, t_j_1: float, t_j_2: float, simfilepath: str, timestep: float, number_sim_periods: int, transistor_1_name: str, transistor_2_name: str, lossfilepath: str, i_ls_start: ndarray, i_lc1_start: ndarray, i_lc2_start: ndarray, timestep_pre: float = 0, number_pre_sim_periods: int = 0, geckoport: int = 43036, c_par_1: float | None = None, c_par_2: float | None = None, get_waveforms: bool = False) tuple[dict, defaultdict]

Start the GeckoCIRCUITS simulation.

Parameters:
  • mesh_v1 (np.array) – mesh of voltage v1 in V

  • mesh_v2 (np.array) – mesh of voltage v2 in V

  • mesh_p (np.array) – mesh of the power P in W

  • mod_phi (np.array) – matrix with modulation parameter phi

  • mod_tau1 (np.array) – matrix with modulation parameter tau_1

  • mod_tau2 (np.array) – matrix with modulation parameter tau_2

  • t_dead1 (float) – dead time for bridge 1 in seconds

  • t_dead2 (float) – dead time for bridge 2 in seconds

  • fs (float) – switching frequency in Hz

  • ls (float) – series inductance in H

  • lc1 (float) – Commutation inductance for bridge 1 in H

  • lc2 (float) – Commutation inductance for bridge 2 in H

  • n (float) – transfer ratio

  • t_j_1 (float) – MOSFET junction temperature for bridge 1 in degree Celsius

  • t_j_2 (float) – MOSFET junction temperature for bridge 2 in degree Celsius

  • simfilepath (float) – simulation file filepath

  • timestep (float) – timestep in seconds, e.g. 5e-9

  • number_sim_periods (int) – simulation periods

  • timestep_pre (float) – time-steps of pre-simulation, e.g. 50e-9

  • number_pre_sim_periods (int) – pre-simulation periods (not recorded)

  • geckoport (int) – port of GeckoCIRCUITS to connect

  • c_par_1 (float) – parasitic capacitance for one single MOSFET of bridge 1

  • c_par_2 (float) – parasitic capacitance for one single MOSFET of bridge 2

  • get_waveforms (bool) – True to return i_Ls, i_Lc1 and i_Lc2. Defaults to False.

  • lossfilepath (str) – file path of loss files for transistors

  • transistor_1_name (str) – Name of transistor 1

  • transistor_2_name (str) – Name of transistor 2

  • i_ls_start (np.array) – start current of L_s in A

  • i_lc1_start (np.array) – start current of L_c1 in A

  • i_lc2_start (np.array) – start current of the L_c2 in A (on secondary side)

dct.timeit(func)

Measure execution time of a function by the use of a decorator.

Use this in front of a function to measure execution time @timeit

Parameters:

func (python function) – function to stop the time

dct.transistor_conduction_loss(transistor_rms_current: float, transistor_dto: TransistorDTO) ndarray

Calculate the transistor conduction losses.

Parameters:
  • transistor_rms_current (float) – transistor RMS current in A

  • transistor_dto (dct.TransistorDTO) – transistor DTO (Data transfer object)

Returns:

transistor conduction loss in W

Return type:

float