Model Reduction¶
device_inductance.model_reduction ¶
Eigenmode-based dimensionality reduction for the part of the inductor system that is a coupled L-R system - that is, conducting structure and and coils that are shorted. Shorted coils are taken as a kind of conducting structure here.
Suppose we have a symmetric NxN system mutual inductance matrix like this:
Mutual Inductance
Coils Structure
__________ _______________
| | |
| 0 | 2 | P
| | |
|__________|_______________|
| | |
| | |
| 3 | 1 | Q
| | |
| | |
|__________|_______________|
P Q
The regions are
- 0: Coil-coil interaction, PxP
- 1: Structure-Structure interaction QxQ
- 2,3: Coil-structure interaction, PxQ, QxP, with M_2.t() == M_3
...where P + Q = N.
We need to shrink regions 1,2,3 because while there are typically only around 10 coils in region 0, there may be hundreds or thousands of conducting structure elements contributing to the dimension of 1,2,3, resulting in O(1e4)-O(1e6) nonzeros.
We'd rather have around O(1e2)-O(1e3) nonzeros in the entire mutual inductance matrix, and we can sacrifice some modeling resolution w.r.t. the conducting structure in order to achieve that dimensionality reduction while preserving the detail of the active coils in region 0.
In order to do this, we need a non-square system transformation matrix of shape KxQ that can reduce the QxQ region 1 to some smaller size QxK, and can also reduce the PxQ,QxP regions 2,3 to PxK,KxP while preserving their effect the overall system behavior w.r.t. the coil region 0 as well as possible.
Eigenvector decomposition is a good candidate for this - the matrix of eigenvectors preserves the behavior of the system. It also gives a convenient ordering of the importance of each row and column (the eigenvalues) in order to allow us to truncate the matrix of eigenvectors and arrive at a truncated KxQ shape.
Now, it's not specifically the mutual inductance matrix itself that we need to shrink, but the whole corresponding state-space system. In this case, regions 1,2,3 (passive structure) relate to a coupled inductive-resistive system, with self-interaction time scales
where M_1 is the portion of M in region 1, and R is the diagonal matrix of loop resistances associated with each piece of conducting structure or shorted coil:So, we can get the transformation matrix we need by taking the top few eigenvectors of A:
where K is an empirically-tuned integer value with, hopefully, K << Q.This gives a rectangular transformation matrix that fits our need:
and can be used as an adapter between the reduced-order model of the structure self-interaction represented by and the coupling regions 2,3 as well as tensors tabulating linear field contributions from each structural element (flux, B-field, mutual inductance, etc): psi* = psi @ Tuv # With psi tables shaped like (W, Q) for W grid points
br* = br @ Tuv
...and so on.
1/dI/dt = (-R^-1 @ M) @ v and take the largest-magnitude eigenvalues with significantly
reduced numerical error.
This is not the only reasonable choice for formulating the transformation matrix. In particular, some other methods offer particular advantages in exchange for complexity: * Iterative SVD can be faster than proper eigenvalue decomposition * State-space balanced reduction gives a closer approximation of the important parts of system dynamics, especially phase response, but can suffer numerically with large systems
eigenmode_reduction ¶
Do eigenmode decomposition of inductive-resistive system and truncate
to top max_neig terms.
See module-level docs for more detail about the model reduction approach.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
m
|
NDArray
|
[H] QxQ symmetric mutual inductance matrix for conducting structure |
required |
r
|
NDArray
|
[ohm] QxQ diagonal resistance matrix for conducting structure |
required |
max_neig
|
int | None
|
Optional maximum number of eigenvalues to keep. None -> keep all. |
required |
Returns:
| Type | Description |
|---|---|
tuple[NDArray, NDArray, int]
|
(d, tuv, neig), Eigenvalues in [s], QxK transformation matrix with K <= Q, and number of terms |
Source code in src/device_inductance/model_reduction.py
stabilized_eigenmode_reduction ¶
stabilized_eigenmode_reduction(
m: NDArray, r: NDArray, max_neig: int | None
) -> tuple[NDArray, NDArray, int]
This method can be more computationally stable than the direct method, and may give better results for slightly-asymmetric systems that are intended to be fully physically symmetric.
This is essentially direct (eigendecomposition) PCA.
See module-level docs for more detail about the model reduction approach.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
m
|
NDArray
|
[H] QxQ symmetric mutual inductance matrix for conducting structure |
required |
r
|
NDArray
|
[ohm] QxQ diagonal resistance matrix for conducting structure |
required |
max_neig
|
int | None
|
Optional maximum number of eigenvalues to keep. None -> keep all. |
required |
Returns:
| Type | Description |
|---|---|
tuple[NDArray, NDArray, int]
|
(d, tuv, neig), Eigenvalues in [s], QxK transformation matrix with K <= Q, and number of terms |