For this example, consider sparseSOSignal.mat
that contains a sparse second-order model. Define an actuator, sensor, and controller and connect them together with the plant in a feedback loop.
Load the sparse matrices and create the mechss
object.
Next, create an actuator and sensor using transfer functions.
Create a PID controller object for the plant.
Use the feedback
command to connect the plant, sensor, actuator, and controller in a feedback loop.
Sparse continuous-time second-order model with 1 outputs, 1 inputs, and 7111 nodes.
Use "spy" and "showStateInfo" to inspect model structure.
Type "properties('mechss')" for a list of model properties.
Type "help mechssOptions" for available solver options for this model.
The resultant system sys
is a mechss
object since mechss
objects take precedence over all other model object types.
Use showStateInfo
to view the component and signal groups.
The state groups are:
Type Name Size
-------------------------------
Component Sensor 1
Component Plant 7102
Signal 1
Component Actuator 2
Signal 1
Component Controller 2
Signal 1
Signal 1
Use xsort
to sort the components and signals, and then view the component and signal groups.
The state groups are:
Type Name Size
-------------------------------
Component Sensor 1
Component Plant 7102
Component Actuator 2
Component Controller 2
Signal 4
Observe that the components are now ordered before the signal partition. The signals are now sorted and grouped together in a single partition.
You can also visualize the sparsity pattern of the resultant system using spy
.