Index: mttroot/mtt/bin/trans/dae2cse_r ================================================================== --- mttroot/mtt/bin/trans/dae2cse_r +++ mttroot/mtt/bin/trans/dae2cse_r @@ -13,10 +13,18 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.2 1997/08/26 08:22:36 peterg +## Changed +## MTTY := MTTY + MTTEyx*MTTdX + MTTEyu*MTTdu; +## to +## MTTY := MTTY + MTTEyx*MTTEdX + MTTEyu*MTTdu; +## +## This sorts out the problem when dz appears in the output equation. +## ## Revision 1.1 1997/08/26 08:20:18 peterg ## Initial revision ## ## Revision 1.2 1996/08/25 09:57:30 peter ## Sorted out bug when MTTNz=0 @@ -31,11 +39,11 @@ # Remove the old log file rm -f dae2cse_r.log # Use reduce to accomplish the transformation -reduce >dae2cse_r.log << EOF +$SYMBOLIC >dae2cse_r.log << EOF OFF Echo; OFF Nat; ON NERO; @@ -47,48 +55,60 @@ %Create F_x, F_y matrices - assumming equations are linear in dZ IF MTTNz>0 THEN BEGIN % Find MTTFx; +write "% Find MTTFx;"; + matrix MTTFx(MTTNx,MTTNz); FOR j := 1:MTTNz DO BEGIN dzj := MTTdZ(j,1); FOR i := 1:MTTNx DO MTTFx(i,j) := df(MTTdX(i,1), dzj, 1); END; % Find MTTFy; +write "% Find MTTFy;"; + matrix MTTFy(MTTNy,MTTNz); FOR j := 1:MTTNz DO BEGIN dzj := MTTdZ(j,1); FOR i := 1:MTTNy DO MTTFy(i,j) := df(MTTy(i,1), dzj, 1); END; %Create G_x, G_u matrices +write "%Create G_x, G_u matrices "; + % Find MTTGx; +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; % Find MTTGu; +write "% Find MTTGu;"; + matrix MTTGu(MTTNz,MTTNu); FOR j := 1:MTTNu DO BEGIN uj := MTTu(j,1); FOR i := 1:MTTNz DO MTTGu(i,j) := df(MTTZ(i,1), uj, 1); END; %Create E matrices +write "%Create E matrices"; + matrix MTTExx(MTTNx,MTTNx); MTTExx := MTTFx*MTTGx; matrix MTTExu(MTTNx,MTTNu); MTTExu := MTTFx*MTTGu; matrix MTTEyx(MTTNy,MTTNx); MTTEyx := MTTFy*MTTGx; matrix MTTEyu(MTTNy,MTTNu); MTTEyu := MTTFy*MTTGu; @@ -117,14 +137,19 @@ MTTdZ18 := 0; MTTdZ19 := 0; MTTEdX := MTTdX; %Ie MTTEdX is MTTdX with the dz terms deleted ie EdX. MTTdX := MTTdXs; %Restore the symbolic dX + %%% This causes the matrix mismatch %%% MTTdXs and MTTdu need setting in _def.r file MTTY := MTTY + MTTEyx*MTTEdX + MTTEyu*MTTdu; +%%%%%%MTTY := MTTY + MTTEyx*(MTTE^(-1))*MTTEdX; + + + END; %%of MTTNz>0