Index: mttroot/mtt/bin/trans/ode2smx_lang ================================================================== --- mttroot/mtt/bin/trans/ode2smx_lang +++ mttroot/mtt/bin/trans/ode2smx_lang @@ -12,10 +12,14 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.7 1998/08/27 06:48:20 peterg +## Changed mttxx to mttx - in implicit integration smx is called once +## with x in the linearisation the same as x in the current state +## ## Revision 1.6 1998/08/26 18:25:45 peterg ## SMX now generates both A and Ax ## ## Revision 1.5 1998/08/15 13:51:56 peterg ## smx is now I-Adt NOT A @@ -60,10 +64,12 @@ lang := $lang; in "$1_def.r"; in "$1_ode.r"; +clear mttx; % Dont need this now - use mkid instead + OFF Echo; % Load the general translator package LOAD GENTRAN; GENTRANLANG!* := 'Pascal; @@ -74,24 +80,10 @@ % Matrix output function in"$MTTPATH/trans/lang_matrix.r"; -%Procedure to write out the result according to the language used. -PROCEDURE WriteElement(name, i, j, element); -BEGIN - IF (element NEQ 0) THEN - BEGIN - IF (lang = r) THEN - write name, "(", i, ",", j, ") := ", element; - - IF (lang = m) THEN - GENTRAN foo :=: element; - - END -END; - %Set up output according to the language. OFF NAT; GENTRANOUT "$1_smx.$lang"; % Set up output according to the language. @@ -105,25 +97,25 @@ % find MTTA : the A matrix FOR i := 1:MTTNx DO BEGIN mttAAx_i := 0; - xi := MTTX(i,1); +%% xi := mkid(mttx,i); FOR j := 1:MTTNx DO BEGIN - xj := MTTX(j,1); + xj := mkid(mttx,j); a_ij := df(MTTdx(i,1), xj, 1); - a_ji := df(MTTdx(j,1), xi, 1); +%% a_ji := df(MTTdx(j,1), xi, 1); IF i=j THEN BEGIN aa_ij := 1 - mttdt*a_ij; - aa_ji := aa_ij; +%% aa_ji := aa_ij; END ELSE BEGIN aa_ij := -mttdt*a_ij; - aa_ji := -mttdt*a_ji; +%% aa_ji := -mttdt*a_ji; END; IF (aa_ij NEQ 0) THEN GENTRAN mtta(i,j) ::=: aa_ij; mttAAx_i := mttAAx_i + aa_ij*mkid(mttx,j); %%%mttAAtx(i,1) := mttAAtx(i,1) + aa_ji*mkid(mttx,j);