% INDMAT.M %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Index matrices
% For DAE Solver
global coldata
im_x1 = 1:3 * coldata.Nt(1);
im_x2 = im_x1(end) + [1:3 * coldata.Nt(2)];
im_x3 = im_x2(end) + [1:3 * coldata.Nt(3)];
im_x4 = im_x3(end) + [1:3 * coldata.Nt(4)];
im_x5 = im_x4(end) + [1:3 * coldata.Nt(5)];
im_x6 = im_x5(end) + [1:3 * coldata.Nt(6)];
im_x7 = im_x6(end) + [1:3 * coldata.Nt(7)];
im_xr = im_x7(end) + [1:3];
im_xt = im_xr(end) + [1:3];
im_xL = im_xt(end) + [1:3];
im_xS1 = im_xL(end) + [1:3];
im_xS2 = im_xS1(end) + [1:3];

im_T1 = im_xS2(end) + [1:coldata.Nt(1)];
im_T2 = im_T1(end) + [1:coldata.Nt(2)];
im_T3 = im_T2(end) + [1:coldata.Nt(3)];
im_T4 = im_T3(end) + [1:coldata.Nt(4)];
im_T5 = im_T4(end) + [1:coldata.Nt(5)];
im_T6 = im_T5(end) + [1:coldata.Nt(6)];
im_T7 = im_T6(end) + [1:coldata.Nt(7)];
im_Tr = im_T7(end) + 1;


im_m1 = im_Tr(end) + [1:coldata.Nt(1)];
im_m2 = im_m1(end) + [1:coldata.Nt(2)];
im_m3 = im_m2(end) + [1:coldata.Nt(3)];
im_m4 = im_m3(end) + [1:coldata.Nt(4)];
im_m5 = im_m4(end) + [1:coldata.Nt(5)];
im_m6 = im_m5(end) + [1:coldata.Nt(6)];
im_m7 = im_m6(end) + [1:coldata.Nt(7)];
im_mr = im_m7(end) + 1;
im_mt = im_mr(end) + 1;
im_mL = im_mt(end) + 1;
im_mS1 = im_mL(end) + 1;
im_mS2 = im_mS1(end) + 1;


