Skip to content

Commit

Permalink
Merge pull request #2 from ethz-pes/v4.0
Browse files Browse the repository at this point in the history
v4.0
  • Loading branch information
otvam authored Aug 10, 2020
2 parents 172b767 + ca7716f commit 51625a8
Show file tree
Hide file tree
Showing 151 changed files with 652 additions and 523 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
*.idea

# folder with data
data/*
dataset/*.zip
dataset/*.mat
design/*.zip
design/*.mat

# release folder
resources/maintenance/release_archive
Binary file added PAPER.pdf
Binary file not shown.
77 changes: 39 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,14 @@ The following performances are achieved:
* The tool is able **generate 300'000 designs per second** on a laptop computer
* The tool is able for compute **50'000 operating points per second** on a laptop computer

## Tutorial

This [short tutorial](TUTORIAL.md) explains how to install the tool, design inductors, and obtain Pareto fronts.

## Scientific Paper

A **scientific paper** has been published in the **IEEE Open Journal of Power Electronics** about this tool. The paper describes the method used in the tool and presents some results (ANN trainings and inductor optimization). The paper is available as open-acces:
* [PDF version](paper.pdf)
* [PDF version](PAPER.pdf)
* [DOI link](https://doi.org/10.1109/OJPEL.2020.3012777)

## Simplified Workflow
Expand All @@ -48,41 +52,34 @@ A **scientific paper** has been published in the **IEEE Open Journal of Power El
<img src="resources/img_readme/screenshot_6.png" width="400">
</p>

## Getting Started / Example
## Code Structure

The following code structure is considered:
* [dataset](dataset) - FEM dataset and trained ANNs (the data are only included in the releases, not in the repository)
* [design](design) - Inductor design results (the data are only included in the releases, not in the repository)
* [resources](resources) - Different resources which are not directly used in the toolbox
* [source_ann](source_ann) - ANN library for regression/fitting (standalone code, see [README.md](source_ann/README.md))
* [source_inductor](source_inductor) - Source code for the FEM/ANN inductor design tool
* [source_input](source_input) - Input data and parameters defined by the user
* [paper.pdf](paper.pdf) - Scientific paper published in IEEE OJ-PEL
* [init_toolbox.m](init_toolbox.m) - Load the MATLAB toolbox
* [run_dataset](run_dataset) - Code for creating the dataset and training the ANNs
* [run_dataset_1_init.m](run_dataset/run_dataset_1_init.m) - Init the simulations with constant data
* [run_dataset_2_fem.m](run_dataset/run_dataset_2_fem.m) - Run the different FEM simulations
* [run_dataset_3_assemble.m](run_dataset/run_dataset_3_assemble.m) - Assemble the FEM simulations results, add the analytical solutions
* [run_dataset_4_train.m](run_dataset/run_dataset_4_train.m) - Train the regressions with ANNs with simulation results
* [run_dataset_5_export.m](run_dataset/run_dataset_5_export.m) - Export the ANNs in prevision of the evaluation of inductor designs
* [run_design](run_design) - Code for designing inductors and plotting the results
* [run_design_compute_single.m](run_design/run_design_compute_single.m) - Simulate a single inductor design and plot the result (ANN or FEM or ana. approx)
* [run_design_compute_pareto.m](run_design/run_design_compute_pareto.m) - Optimize many inductor designs and make Pareto plots (ANN or ana. approx.)
* [src](src) - Source code (backend)
* [ann_regression](src/ann_regression) - ANN library for regression/fitting (standalone code, see [readme](src/ann_regression/README.md))
* [inductor_dataset](src/inductor_dataset) - Source code for the FEM dataset and ANN training
* [inductor_design](src/inductor_design) - Source code for the inductor design
* [utils](src/utils) - Different small utils functions
* [init_toolbox.m](init_toolbox.m) - Load the MATLAB toolbox
* [run_0_init.m](run_0_init.m) - Init the simulations with constant data
* [run_1_fem.m](run_1_fem.m) - Run the different FEM simulations
* [run_2_assemble.m](run_2_assemble.m) - Assemble the FEM simulations results, add the analytical solutions
* [run_3_train.m](run_3_train.m) - Train the regressions with ANNs with simulation results
* [run_4_export.m](run_4_export.m) - Export the ANNs in prevision of the evaluation of inductor designs
* [run_5_compute_all.m](run_5_compute_all.m) - Simulate many inductor designs (ANN or ana. approx.)
* [run_6_compute_single.m](run_6_compute_single.m) - Simulate a single inductor design (ANN or FEM or ana. approx)
* [run_7_plot_all.m](run_7_plot_all.m) - Plot the optimization results (Pareto fronts) in a GUI
* [run_8_plot_single.m](run_8_plot_single.m) - Display a single design in a GUI
* [run_ann_server.py](run_ann_server.py) - Python ANN server for using Keras and TensorFlow from MATLAB
* Shell script (Linux) and (batch) script (MS Windows) for starting the Python ANN server
* Shell script (Linux) and (batch) script (MS Windows) for starting the COMSOL MATLAB Livelink
* Readme and license files

The included example shows the complete workflow:
* FEM simulations (dataset generation)
* ANN training (magnetic and thermal)
* Design computation and optimization
* The inductor of a DC-DC Buck converter is optimized
* The converter has the following ratings: 2kW, 400V input voltage, 200V output voltage
* The following parameters are optimized: frequency, geometry, air gap, number of turns, ripple
* Result analysis
* Interactive GUI
* Pareto fronts exploration

* [LICENSE.md](LICENSE.md) - License files
* [README.md](README.md) - Readme file
* [TUTORIAL.md](TUTORIAL.md) - Simple inductor optimization tutorial
* [PAPER.pdf](PAPER.pdf) - Scientific paper published in IEEE OJ-PEL
* [start_comsol_matlab.bat](start_comsol_matlab.bat) - Batch script (MS Windows) for starting the COMSOL MATLAB Livelink
* [start_comsol_matlab.sh](start_comsol_matlab.sh) - Shell script (Linux) for starting the COMSOL MATLAB Livelink

## Inductor Optimization Capabilities

Currently the following inductors are optimized:
Expand Down Expand Up @@ -144,19 +141,23 @@ The releases are available at GitHub and contains:
* An archive (zip or tar.gz) containing the generated data (FEM solution, trained ANN, etc.)
* [GitHub Releases](https://github.com/ethz-pes/AI-mag/releases)

> **WARNING**: The repository does NOT contain the dataset and the trained ANNs.
> **WARNING**: The dataset and the trained ANNs are only included in the releases.
## Metrics

```
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
MATLAB 105 1790 5147 4888
Python 8 365 451 450
Markdown 6 93 0 331
DOS Batch 3 9 0 34
Bourne Shell 3 9 9 21
MATLAB 107 1795 5144 4925
Markdown 7 118 0 504
Python 7 343 417 415
DOS Batch 2 6 0 24
Bourne Shell 2 6 6 14
-------------------------------------------------------------------------------
SUM: 125 2266 5607 5724
SUM: 125 2268 5567 5882
-------------------------------------------------------------------------------
```

Expand Down
183 changes: 183 additions & 0 deletions TUTORIAL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
# AI-mag: Short Tutorial

## Goal of the Tutorial

This is a simple example how to design an inductor:
* Design computation and optimization
* Single design
* Pareto optimization
* Result analysis
* Interactive GUI
* Pareto fronts exploration

The following inductor is considered.
* Non-isolated DC-DC Buck converter
* Converter ratings: 2kW, 400V input voltage, 200V output voltage
* Optimized parameters: frequency, geometry, air gap, number of turns, ripple

## Installation and Initialization

> **WARNING**: The repository does NOT contain the dataset and the trained ANNs.
> **WARNING**: The dataset and the trained ANNs are only included in the releases.
* Go to the latest release: [download](https://github.com/ethz-pes/AI-mag/releases/latest)
* Download the source code: "Source code (zip)" or "Source code (tar.gz)"
* Unpack the source code
* Download the data: "data.zip" or "data.tar.gz"
* Unpack the data (replace the folder "dataset" and "design")
* Start MATLAB and go to the corresponding folder
* Type "init_toolbox" to load the toolbox

## Run a Single Inductor Design

```
>> run_design_compute_single
________________________________________________________
| _________ ___ |
| / ___ / /__/ _ __ ___ __ _ __ _ |
| / /__/ / / / ___ | `_ ` _ \ / _` |/ _` | |
| / ___ / / / /___| | | | | | | (_| | (_| | |
| /__/ /__/ /__/ |_| |_| |_|\__,_|\__, | |
| |___/ |
|________________________________________________________|
| |
| Fast and Accurate Inductor Modeling and Design |
| With Artificial Neural Network (ANN) |
| With Finite Element Method (FEM) |
|________________________________________________________|
| ____________________ ___ |
| / ________ ___ /__/ / ETH Zurich |
| / _____/ / / / ___ / Power Electronic |
| /_______/ /__/ /__/ /__/ Systems Laboratory |
|________________________________________________________|
| |
| T. Guillod, Power Electronic Systems Laboratory |
| Copyright 2019-2020 ETH Zurich / BSD License |
|________________________________________________________|
Select the simulation type:
1 - ANN-based model
2 - Analytical approximation
2 - FEM simulation (require COMSOL Livelink)
Enter your choice >> 1
################## master_compute_single
load
ann fem
run
info
single design
diff = 00:00:00
save
################## master_compute_single
################## master_plot_single
load
gui
################## master_plot_single
```

<p float="middle">
<img src="resources/img_tutorial/tutorial_single.png" width="700">
</p>

## Run a Pareto Fronts

```
>> run_design_compute_pareto
________________________________________________________
| _________ ___ |
| / ___ / /__/ _ __ ___ __ _ __ _ |
| / /__/ / / / ___ | `_ ` _ \ / _` |/ _` | |
| / ___ / / / /___| | | | | | | (_| | (_| | |
| /__/ /__/ /__/ |_| |_| |_|\__,_|\__, | |
| |___/ |
|________________________________________________________|
| |
| Fast and Accurate Inductor Modeling and Design |
| With Artificial Neural Network (ANN) |
| With Finite Element Method (FEM) |
|________________________________________________________|
| ____________________ ___ |
| / ________ ___ /__/ / ETH Zurich |
| / _____/ / / / ___ / Power Electronic |
| /_______/ /__/ /__/ /__/ Systems Laboratory |
|________________________________________________________|
| |
| T. Guillod, Power Electronic Systems Laboratory |
| Copyright 2019-2020 ETH Zurich / BSD License |
|________________________________________________________|
Select the simulation type:
1 - ANN-based model
2 - Analytical approximation
Enter your choice >> 1
################## master_compute_pareto
load
ann fem
sweep
split
run
6 / 6
5 / 6
4 / 6
3 / 6
2 / 6
1 / 6
assemble
info
diff = 00:00:20
n_tot = 519683
n_filter_var = 519683
n_filter_fom = 120399
n_sol = 44333
save
################## master_compute_pareto
################## master_plot_pareto
load
gui
################## master_plot_pareto
```

<p float="middle">
<img src="resources/img_tutorial/tutorial_pareto.png" width="700">
</p>

## Change the Simulation Parameters

All the files describing the inductor computation and optimization are located in the [run_design](run_design) folder:
* [run_design_compute_single.m](run_design/run_design_compute_single.m) - Single design (entry point)
* [run_design_compute_pareto.m](run_design/run_design_compute_pareto.m) - Pareto fronts (entry point)
* [material](run_design/material) - Material database
* [core_data.mat](run_design/material/core_data.mat) - Core data (losses, permeability, saturation, etc.)
* [iso_data.mat](run_design/material/iso_data.mat) - Insulation data (weight, thermal properties, etc.)
* [winding_data.mat](run_design/material/winding_data.mat) - Winding data (stranding, fill factor, etc.)
* [param](run_design/param) - User defined parameters
* [get_design_param_compute_pareto.m](run_design/param/get_design_param_compute_pareto.m) - Definition of the parameter sweep (many designs)
* [get_design_param_compute_pareto.m](run_design/param/get_design_param_compute_single.m) - Definition of the parameter (single design)
* [get_design_param_plot_pareto.m](run_design/param/get_design_param_plot_pareto.m) - Parameters for the Pareto fronts
* [get_design_circuit.m](run_design/param/get_design_circuit.m) - Applied stress on the inductor (current, voltage, etc.)
* [get_design_excitation.m](run_design/param/get_design_excitation.m) - Inductor operating point definition
* [get_design_data_vec.m](run_design/param/get_design_data_vec.m) - Inductor parameters
* [get_design_fct.m](run_design/param/get_design_fct.m) - Functions for filtering invalid designs
* [get_design_data_const.m](run_design/param/get_design_data_const.m) - Parameters for the numerical methods

## FEM Dataset and ANN Training

In this tutorial, pre-trained ANNs have been used.
However, if required, the dataset and the ANNs can be generated from scratch.

All the files describing the dataset generation and the ANN training are located in the [run_dataset](run_dataset) folder:
* [run_dataset_1_init.m](run_dataset/run_dataset_1_init.m) - Init the simulations with constant data (entry point)
* [run_dataset_2_fem.m](run_dataset/run_dataset_2_fem.m) - Run the different FEM simulations (entry point)
* [run_dataset_3_assemble.m](run_dataset/run_dataset_3_assemble.m) - Assemble the FEM simulations results, add the analytical solutions (entry point)
* [run_dataset_4_train.m](run_dataset/run_dataset_4_train.m) - Train the regressions with ANNs with simulation results (entry point)
* [run_dataset_5_export.m](run_dataset/run_dataset_5_export.m) - Export the ANNs in prevision of the evaluation of inductor designs (entry point)
* [model](run_dataset/model) - COMSOL models
* [model_ht.mph](run_dataset/model/model_ht.mph) - COMSOL 3D model for the thermal simulations
* [model_mf.mph](run_dataset/model/model_mf.mph) - COMSOL 3D model for the magnetic simulations
* [param](run_dataset/param) - User defined parameters
* [get_dataset_param_init.m](run_dataset/param/get_dataset_param_init.m) - Constant physical parameters
* [get_dataset_param_fem.m](run_dataset/param/get_dataset_param_fem.m) - Parameters for generating the FEM dataset
* [get_dataset_param_train.m](run_dataset/param/get_dataset_param_train.m) - Parameters for training the ANNs
9 changes: 9 additions & 0 deletions dataset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# AI-mag: Dataset

This folder contains:
* The 3D FEM datasets (thermal simulations and magnetic simulations)
* The trained ANNs (thermal ANN and magnetic ANN)

Concerning the availability of these data:
* These data are NOT included in the repository: [GitHub Repository](https://github.com/ethz-pes/AI-mag).
* These data are ONLY included in the releases: [GitHub Releases](https://github.com/ethz-pes/AI-mag/releases).
9 changes: 9 additions & 0 deletions design/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# AI-mag: Inductor Designs

This folder contains the simulated inductor designs:
* Single inductor design
* Many inductor designs (Pareto fronts)

Concerning the availability of these data:
* These data are NOT included in the repository: [GitHub Repository](https://github.com/ethz-pes/AI-mag).
* These data are ONLY included in the releases: [GitHub Releases](https://github.com/ethz-pes/AI-mag/releases).
6 changes: 3 additions & 3 deletions init_toolbox.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ function init_toolbox()
% (c) 2019-2020, ETH Zurich, Power Electronic Systems Laboratory, T. Guillod

% add path
addpath(genpath('source_ann'))
addpath(genpath('source_inductor'))
addpath(genpath('source_input'))
addpath(genpath('src'))
addpath(genpath('run_dataset'))
addpath(genpath('run_design'))

% init random number generators
rng('shuffle')
Expand Down
Binary file added resources/img_tutorial/tutorial_pareto.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/img_tutorial/tutorial_single.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 51625a8

Please sign in to comment.