COMSOL Multiphysics models often have a large number of degrees of freedom. This leads to large state-space model when exported using mphstate. COMSOL Multiphysics provides model reduction functionality, which can reduce the number of states using an eigenvalue (or eigenfrequency) study leading to a low number of states that can be used for simulation and analysis.
The function mphreduction returns state-space matrices or a MATLAB state-space model using the
ss function of a given reduced-order model set in the COMSOL model.
In this section you will find an example that illustrate how to use the mphreduction function to extract the reduced order model state-space matrices.
This is the same problem solved as in Extracting State-Space Matrices so you can compare the solution, and computational performance when solving the problem with full state space system matrices.
A call to mphreduction creates the state-space matrices needed to simulate the reduced-order system.
As an alternative to using ode23s, you can use functions in the Control System Toolbox, which is an add-on to MATLAB. The matrices stored in
MR can be used to manually construct a state-space system using the function
ss, or you can call
mphreduction using the return option to specify that
mphreduction should do the conversion.