sdynpy.modal.sdynpy_modeshape.stack_and_lstsq
- stack_and_lstsq(frf_matrix, kernel_matrix, return_reconstruction=False, reconstruction_partitions=None, reconstruction_kernel=None)[source]
Stacks the frf and kernel matrices appropriately, then solves the least-squares problem
- Parameters
frf_matrix (np.ndarray) – A num_outputs x num_inputs x num_frequencies array representing the frequency response function matrix.
kernel_matrix (np.ndarray) – A num_inputs x 2*num_freq x num_coefficients kernel matrix from generated from generate_kernel_complex or generate_kernel_real functions.
return_reconstruction (bool) – If True, a reconstruction of the frequency response function matrix using the kernel and the computed shape coefficients. Default is False.
reconstruction_paritions (list) – If specified, a list of reconstructions will be returned. For each entry in this list, a frf matrix will be reconstructed using the entry as indices into the coefficient matrix’s rows and the kernel matrix’s columns. This allows, for example, reconstruction of the frf matrix using only the residual terms or only the shape terms. If not specified when return_reconstruction is True, only one frf matrix will be returned using all shape coefficients.
reconstruction_kernel (np.ndarray) – A separate kernel matrix used for reconstruction. If not specified, the kernel matrix used to solve the least-squares problem will be used for the reconstruction.
- Returns
coefficients (np.ndarray) – A num_coefficients x num_outputs array of solution values to the least-squares problem.
reconstruction (np.ndarray or list of np.ndarray) – A frf matrix reconstructed from the kernel and the shape coefficients. If multiple reconstruction_partitions are specified in a list, then this return value will also be a list of reconstructions corresponding to those partitions. This will only be returned if return_reconstruction is True.