pymor.reductors.loewner¶
Classes
Reductor based on Loewner interpolation framework. |
- class pymor.reductors.loewner.LoewnerReductor(s, Hs, partitioning='even-odd', ordering='regular', force_real=True, mimo_handling='full')[source]¶
Bases:
CacheableObjectReductor based on Loewner interpolation framework.
The reductor implements interpolation based on the Loewner framework as in [ALI17].
- Parameters:
s –
NumPy arrayof shape(n,)containing the frequencies.Hs –
NumPy arrayof transfer function samples, of shape(n, p, m)for MIMO systems withpoutputs andminputs or(n,)for SISO systems. Usegenerate_samplesto generate data beforehand.partitioning –
strortupleof length 2. Strings can either be'even-odd'or'half-half'defining the partitioning rule. A user-defined partitioning can be defined by passing a tuple of the left and right indices. Defaults to'even-odd'.ordering – The ordering with respect to which the partitioning rule is executed. Can be either
'magnitude','random'or'regular'. Defaults to'regular'.force_real – Whether to guarantee realness of reduced
LTIModelby keeping complex conjugates in the same partitioning or not. IfTruewill automatically generate conjugate data if necessary.mimo_handling –
Option indicating how to treat MIMO systems. Can be:
'random'for using random tangential directions.'full'for fully interpolating all input-output pairs.Tuple
(ltd, rtd)whereltdcorresponds to left andrtdto right tangential directions. Ifforce_real=True, directions at conjugate nodes must be conjugates.
Attributes
- static generate_samples(sampling_values, fom, *, derivative=False)[source]¶
Sample a
TransferFunctionor its derivative on a Cartesian grid.- Parameters:
sampling_values – A one-dimensional
NumPy arrayor a sequence of such arrays. The first array contains Laplace-variable values; subsequent arrays contain parameter values.fom – A
TransferFunctionor a model with atransfer_functionattribute.derivative – If
True, sample the derivative with respect to the complex frequency argument.
- Returns:
samples – Sample data of shape
tuple(map(len, sampling_values)) + (dim_output, dim_input). A single frequency array produces shape(n, dim_output, dim_input).
- loewner_quadruple()[source]¶
Construct a Loewner quadruple as
NumPy arrays.The Loewner quadruple [ALI17]
\[(\mathbb{L},\mathbb{L}_s,V,W)\]consists of the Loewner matrix \(\mathbb{L}\), the shifted Loewner matrix \(\mathbb{L}_s\), left interpolation data \(V\) and right interpolation data \(W\).
- reduce(r=None, tol=1e-12)[source]¶
Reduce using Loewner framework.
- Parameters:
r – Integer for target order of reduced model. If an interpolant with order less than r exists then the output will have the minimal order of an interpolant. Otherwise, the output will be an
LTIModelwith order r. IfNonethe order of the reduced model will be the minimal order of an interpolant.tol – Truncation tolerance for rank of Loewner matrices.
- Returns:
rom – Reduced
LTIModel.
- cache_region = 'memory'[source]¶
Name of the
CacheRegionto use.Must correspond to a key in the
cache_regionsdict. IfNoneor'none', caching is disabled.