Index: mttroot/mtt/bin/trans/dae2cse_r ================================================================== --- mttroot/mtt/bin/trans/dae2cse_r +++ mttroot/mtt/bin/trans/dae2cse_r @@ -13,10 +13,13 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.7 1998/10/05 10:46:15 peterg +## Commented out redundant MTTY := MTTY + MTTEyx*MTTEdX; +## ## Revision 1.6 1998/07/19 12:44:35 peterg ## Set MTTYz := 0 if the array is empty - avoids irritating error ## message. ## ## Revision 1.5 1998/05/20 15:23:26 peterg @@ -77,10 +80,14 @@ %Create F_x, F_y matrices - assumming equations are % linear in dZ IF MTTNz>0 THEN BEGIN + +IF MTTNx>0 THEN +BEGIN + % Find MTTFx; write "% Find MTTFx;"; matrix MTTFx(MTTNx,MTTNz); FOR j := 1:MTTNz DO @@ -87,10 +94,12 @@ BEGIN dzj := MTTdZ(j,1); FOR i := 1:MTTNx DO MTTFx(i,j) := df(MTTdX(i,1), dzj, 1); END; + +END; % Find MTTFy; write "% Find MTTFy;"; matrix MTTFy(MTTNy,MTTNz); @@ -104,19 +113,22 @@ %Create G_x, G_u matrices write "%Create G_x, G_u matrices "; % Find MTTGx; +IF MTTNx>0 THEN +BEGIN write "% Find MTTGx;"; matrix MTTGx(MTTNz,MTTNx); FOR j := 1:MTTNx DO BEGIN xj := MTTX(j,1); FOR i := 1:MTTNz DO MTTGx(i,j) := df(MTTZ(i,1), xj, 1); END; +END; % Find MTTGu; write "% Find MTTGu;"; matrix MTTGu(MTTNz,MTTNu); @@ -128,17 +140,20 @@ END; %Create E matrices write "%Create E matrices"; +IF MTTNx>0 THEN +BEGIN matrix MTTExx(MTTNx,MTTNx); MTTExx := MTTFx*MTTGx; matrix MTTExu(MTTNx,MTTNu); MTTExu := MTTFx*MTTGu; matrix MTTEyx(MTTNy,MTTNx); MTTEyx := MTTFy*MTTGx; +matrix MTTE(MTTNx,MTTNx); MTTE := MTTI - MTTExx; +END; matrix MTTEyu(MTTNy,MTTNu); MTTEyu := MTTFy*MTTGu; -matrix MTTE(MTTNx,MTTNx); MTTE := MTTI - MTTExx; %% The following gets rid of the dZs; there must be a better way. MTTdZ1 := 0; MTTdZ2 := 0; @@ -158,22 +173,27 @@ MTTdZ16 := 0; MTTdZ17 := 0; MTTdZ18 := 0; MTTdZ19 := 0; +IF MTTNx>0 THEN +BEGIN MTTEdX := MTTdX; %Ie MTTEdX is MTTdX with the dz terms deleted ie EdX. MTTdX := MTTdXs; %Restore the symbolic dX %% Add on input derivative terms MTTEdX := MTTEdX + MTTExu*MTTdu; +END; %%%%%MTTY := MTTY + MTTEyx*MTTEdX; %%% This causes the matrix mismatch %%% MTTdXs and MTTdu need setting in _def.r file MTTY := MTTY + MTTEyu*MTTdu; -MTTY := MTTY + MTTEyx*(MTTE^(-1))*MTTEdX; + +IF MTTNx>0 THEN + MTTY := MTTY + MTTEyx*(MTTE^(-1))*MTTEdX; END; %%of MTTNz>0 IF MTTNz=0 THEN