%% Convert Second-Order Sparse Model to First-Order Sparse Model Representation
% For this example, consider mechssModel.mat that contains a mechss model object ltiSys.
% Load the mechss model object from mechssModel.mat.

load('mechssModel.mat','ltiSys');
ltiSys

% Use the sparss command to convert to first-order sparse representation.

sys = sparss(ltiSys)

% The resultant sparss model object sys has exactly double the number of states than the mechss object ltisys since the mass matrix M is full rank. If the mass matrix is not full rank then the number of states in the resultant sparss model when converting from a mechss model is between n and 2n. Here, n is the number of nodes in the mechss model object.
% Copyright 2020 The MathWorks, Inc.