%% Map Initial Conditions from Continuous-Time Sparse Second-Order Model to Equivalent First-Order Model
% For this example, consider a continuous-time sparse second-order model with 108 nodes. The row vectors q0 and dq0 are the initial conditions for displacement and velocity, respectively. The vectors q0 and dq0 have the same size as the number of nodes in sys.
% Load the data in sparseSOC.mat and find the initial conditions for an equivalent sparse first-order model using getx0.

load('sparseSOC.mat','sys','q0','dq0');
x0 = getx0(sys,q0,dq0);
size(x0)

% In this case, vector x0 contains 216 states, since x0 =\left[ \begin{array}{ccc}
% q0 \\
% dq0 \end{array} \right].
% Copyright 2020 The MathWorks, Inc.