Knowing the solution in terms of the interface DoFs and modal DoFs, reconstruct the solution for the full model.

Create a structural model for transient analysis.

Create a square cross-section beam geometry and include it in the model.

Plot the geometry, displaying face and edge labels.

Specify the Young's modulus, Poisson's ratio, and mass density of the material.

Fix one end of the beam.

Add a vertex at the center of face 3.

Generate a mesh.

Apply a sinusoidal concentrated force in the *z*-direction on the new vertex.

Specify zero initial conditions.

Define superelement interfaces using the fixed and loaded boundaries. In this case, the reduced order model retains the DoFs on the fixed face and the loaded vertex while condensing all other DoFs in favor of modal DoFs. For better performance, use the set of edges bounding face 5 instead of using the entire face.

Reduce the structure, retaining all fixed interface modes up to `5e5`

.

Next, use the reduced order model to simulate the transient dynamics. Use the `ode15s`

function directly to integrate the reduced system ODE. Working with the reduced model requires indexing into the reduced system matrices `rom.K`

and `rom.M`

. First, construct mappings of indices of `K`

and `M`

to loaded and fixed DoFs by using the data available in `rom`

.

DoFs correspond to translational displacements. If the number of mesh points in a model is `Nn`

, then the toolbox assigns the IDs to the DoFs as follows: the first `1`

to `Nn`

are *x*-displacements, `Nn+1`

to `2*Nn`

are *y*-displacements, and `2Nn+1`

to `3*Nn`

are *z*-displacements. The reduced model object `rom`

contains these IDs for the retained DoFs in `rom.RetainedDoF`

.

Create a function that returns DoF IDs given node IDs and the number of nodes.

Knowing the DoF IDs for the given node IDs, use the `intersect`

function to find the required indices.

In the reduced matrices `rom.K`

and `rom.M`

, generalized modal DoFs appear after the retained DoFs.

Because fixed-end DoFs are not a part of the ODE system, the indices for the ODE DoFs in reduced matrices are as follows.

The relevant components of `rom.K`

and `rom.M`

for time integration are:

Now you have a second-order system of ODEs. To use `ode15s`

, convert this into a system of first-order ODEs by applying linearization. Such a first-order system is twice the size of the second-order system.

The specified concentrated force load in the full system is along the *z*-direction, which is the third DoF in the ODE system. Accounting for the linearization to obtain the first-order system gives the loaded ODE DoF.

Specify the mass matrix and the Jacobian for the ODE solver.

Specify zero initial conditions.

Solve the reduced system by using ode15s and the helper function `CMSODEf`

, which is defined at the end of this example.

Compute the values of the ODE variable and the time derivatives.

Knowing the solution in terms of the interface DoFs and modal DoFs, you can reconstruct the solution for the full model. The `reconstructSolution`

function requires the displacement, velocity, and acceleration at all DoFs in `rom`

. Construct the complete solution vector, including the zero values at the fixed DoFs.

Construct a transient results object using this solution.

Compute the displacement in the interior at the center of the beam using the reconstructed solution.