Skip to main content
Version: Next

ngnet

This is an NGnet implementation. It is used for shape representation in the NGnet on/off method[3].

Overview​

NGnet y(w,x)y(\boldsymbol{w}, \boldsymbol{x}) is defined as follows (for a two-dimensional coordinate space).

y(w,x)=∑i=1Nwibi(x)bi(x)=Gi(x)∑j=1NGj(x)Gi(x)=12πσi2exp⁡(−∥x−μi∥22σi2)w={wi},x={x,y}y(\boldsymbol{w}, \boldsymbol{x}) = \sum_{i=1}^{N} w_i b_i(\boldsymbol{x}) \\ b_i(\boldsymbol{x}) = \frac{G_i(\boldsymbol{x})}{\sum_{j=1}^N G_j(\boldsymbol{x})} \\ G_i(\boldsymbol{x}) = \frac{1}{2\pi \sigma_i^2}\exp(-\frac{\|\boldsymbol{x}-\boldsymbol{\mu_i}\|^2}{2\sigma_i^2}) \\ \boldsymbol{w} = \{w_i\}, \boldsymbol{x} = \{x, y\}

w\boldsymbol{w}: Weight vector
x\boldsymbol{x}: Coordinate vector
NN: Number of Gaussian basis functions in the NGnet
μi\mu_i: Center vector of the iith Gaussian basis function Gi(x)G_i(\boldsymbol{x})
σi\sigma_i: Standard deviation of the iith Gaussian basis function Gi(x)G_i(\boldsymbol{x})

In the NGnet on/off method, optimizing the weight vector w\boldsymbol{w} changes the distribution of y(w,x)y(\boldsymbol{w}, \boldsymbol{x}), and the material at each position x\boldsymbol{x} in the design region is determined from its value.
The original paper defines locations where y(w,x)y(\boldsymbol{w}, \boldsymbol{x}) is greater than 0 as the ON-state material (magnetic core), and locations where it is 0 or less as the OFF-state material (air).

Configurable keyword arguments​

  • coordinate: str ... Coordinate system used to construct the NGnet: "Cartesian" or "Polar".
  • sigma: float ... Standard deviation of the Gaussian basis functions in the NGnet. The default is 1.
  • design_region: list[list[float, float], list[float, float]] ... Region used to construct the NGnet (the design region). For Cartesian, specify a rectangular region [[x1,x2],[y1,y2]][[x_1, x_2], [y_1, y_2]]; for Polar, specify a sector region [[r1,r2],[θ1,θ2]][[r_1, r_2], [\theta_1, \theta_2]].
Gaussian basis-function arrangement

By default, the Gaussian basis functions that make up the NGnet are automatically arranged to fill design_region, as shown below.
Each circle in the figure represents the placement of a Gaussian basis function, and its radius represents the standard deviation. The figure is output as gaussian.png directly under the EMSOptimizer folder when shape optimization is run.
Gaussian basis-function arrangement

  • distance_factor: float ... Determines the spacing between Gaussian basis functions. Values below 1 place the functions so that they overlap more. The default is 0.8.
  • dimension: str ... Dimension in which to arrange the Gaussian basis functions: "2D" or "3D". The default is "2D".
  • eliminate_bases_on_edge: bool ... Whether to remove Gaussian basis functions at the region boundaries. The default is False.
  • normalize_output: bool ... Whether to normalize the NGnet output. When False,
    y(w,x)=∑i=1NwiGi(x)y(\boldsymbol{w}, \boldsymbol{x}) = \sum_{i=1}^{N} w_i G_i(\boldsymbol{x}) \\ is used. The default is True.
  • fixed_design_region: list[list[float, float], list[float, float]] | null ... Force the output outside this range to 1. Specify it in the same way as design_region.
  • check_basis_GUI: bool ... When True, launch a GUI at startup to inspect the arrangement of the Gaussian basis functions.