%% Convert Sparse Second-Order Model to Dense Representation
% For this example, consider sparseSOFull.mat that contains a sparse second-order model with 50 nodes.
% Load the sparse second-order model and convert it to dense representation using full.

load('sparseSOFull.mat','sys');
fsys = full(sys);
size(fsys)

% Since, sys is a mechss model, the conversion to dense storage is equivalent to fsys = full(sparss(sys)). The resultant model fsys is a full storage ss model object with 100 states since the mass matrix is full rank.
% Compare the storage size of the two representations.

whos

% Converting to dense storage is not recommended for large scale sparse models as it may saturate available memory and cause severe performance degradation.
% Copyright 2020 The MathWorks, Inc.