pymor.reductors.aaa¶
Module Contents¶
- class pymor.reductors.aaa.PAAAReductor(sampling_values, samples, force_real=True, nsp_tol=1e-16, post_process=True, L_rk_tol=1e-08, parameters=None)[source]¶
Bases:
pymor.core.base.BasicObjectReductor implementing the parametric AAA algorithm.
The reductor implements the parametric AAA algorithm using sampled data. Use
generate_samplesto generate data from a model beforehand. MIMO and non-parametric data is accepted. See [NSeteT18] for the non-parametric and [CRBG23] for the parametric version of the algorithm. The reductor computes approximations based on the multivariate barycentric form \(H(s,p,...)\) (seemake_bary_func), where the inputs \(s,p,...\) are referred to as the variables. Further, \(s\) is the Laplace variable and \(p\) as well as other remaining inputs are parameters.Note
The dimension of the Loewner matrix which will be assembled in the algorithm has
len(sampling_values[0])*...*len(sampling_values[-1])rows. This reductor should only be used with a low number of variables.- Parameters:
sampling_values – Values where sample data has been evaluated. Sampling values are represented as a list of
NumPy arrayssuch thatsampling_values[i]corresponds to sampling values of thei-th variable given as aNumPy array. The first variable is the Laplace variable. In the non-parametric case (i.e., the only variable is the Laplace variable) this can also be aNumPy arrayrepresenting the sampling values.samples – Data sampled at the values specified in
sampling_valuesas aNumPy array. Samples are represented as a tensorS. E.g., for 3 inputsS[i,j,k]corresponds to the sampled value at(sampling_values[0][i],sampling_values[1][j],sampling_values[2][k]). The samples (i.e.,S[i,j,k]) can be scalars or 2-dimensionalNumPy arrays. E.g., in the MIMO caseS[i,j,k]represents a matrix of dimensiondim_outputtimesdim_input.force_real – Whether to compute complex conjugates of first sampling variables and enforce interpolation in complex conjugate pairs (allows for constructing real system matrices).
nsp_tol – Tolerance for null space of higher-dimensional Loewner matrix to check for interpolation or convergence.
post_process – Whether to do post-processing or not. If the Loewner matrix has a null space of dimension greater than 1, it is assumed that the algorithm converged to a non-minimal order interpolant which may cause numerical issues. In this case, the post-processing procedure computes an interpolant of minimal order.
L_rk_tol – Tolerance for ranks of 1-D Loewner matrices computed in post-processing.
parameters – Optional
Parametersor parameter-dimension mapping for the resulting transfer function. Defaults to a single vector parameter namedp. Parameter sampling axes follow the order used byto_numpy.
- itpl_part[source]¶
A nested list such that
itpl_part[i]corresponds to indices of interpolated values with respect to thei-th variable. I.e.,self.sampling_values[i][itpl_part[i]]represents a list of all interpolated samples of thei-th variable.
Methods
Reduce using p-AAA.
- reduce(tol=1e-07, itpl_part=None, max_itpl=None)[source]¶
Reduce using p-AAA.
- Parameters:
tol – Convergence tolerance for relative error of
romover the set of samples.itpl_part – Initial partition for interpolation values. Should be
Noneor a nested list such thatitpl_part[i]corresponds to indices of interpolated values with respect to thei-th variable. I.e.,self.sampling_values[i][itpl_part[i]]represents a list of all initially interpolated samples of thei-th variable. IfNonep-AAA will start with no interpolated values.max_itpl – Maximum number of interpolation points to use with respect to each variable. Should be
Noneor a list such thatself.num_vars == len(max_itpl). IfNonemax_itpl[i]will be set tolen(self.sampling_values[i]) - 1.
- Returns:
rom – Reduced
TransferFunctionmodel.
- pymor.reductors.aaa.make_bary_func(itpl_nodes, itpl_vals, coefs, removable_singularity_tol=1e-14)[source]¶
Return function for (multivariate) barycentric form.
The multivariate barycentric form for two variables is given by
\[H(s,p) = \frac{\sum_{i=1}^{k}\sum_{j=1}^{q}\frac{\alpha_{ij}H(s_i,p_j)}{(s-s_i)(p-p_j)}} {\sum_{i=1}^{k}\sum_{j=1}^{q}\frac{\alpha_{ij}}{(s-s_i)(p-p_j)}}\]where for \(i=1,\ldots,k\) and \(j=1,\ldots,q\) we have that \(s_i\) and \(p_j\) are interpolation nodes, \(H(s_i,p_j)\) are interpolation values and \(\alpha_{ij}\) represent the barycentric coefficients. This implementation can also handle single-variable barycentric forms as well as barycentric forms with more than two variables.
- Parameters:
itpl_nodes – Nested list such that
itpl_nodes[i]contains interpolation nodes of thei-th variable.itpl_vals – Vector of interpolation values with
len(itpl_nodes[0])*...*len(itpl_nodes[-1])entries.coefs – Vector of barycentric coefficients with
len(itpl_nodes[0])*...*len(itpl_nodes[-1])entries.removable_singularity_tol – Tolerance for evaluating the barycentric function at a removable singularity and performing pole cancellation.
- Returns:
bary_func – (Multi-variate) rational function in barycentric form.