Index: mttroot/mtt/bin/trans/ode_r2lang ================================================================== --- mttroot/mtt/bin/trans/ode_r2lang +++ mttroot/mtt/bin/trans/ode_r2lang @@ -13,10 +13,13 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.3 1998/07/19 16:22:29 peterg +## Changed header to inculde mttu +## ## Revision 1.2 1998/06/21 10:40:58 peterg ## Added fsolve error message. ## ## Revision 1.1 1998/05/23 16:17:14 peterg ## Initial revision @@ -27,11 +30,11 @@ language=$2 case $language in m) ext='m'; - codegenerator='FORTRAN' + codegenerator='PASCAL' Lc='#'; Rc='#'; Lb='('; Rb=')'; ;; @@ -64,15 +67,15 @@ # Remove the old log file rm -f ode_r2lang.log #Remove the temporary files rm -f $1_ode.$ext.1 -rm -f $1_odea.$ext.1; -rm -f $1_odeo.$ext.1; +rm -f $1_odea.$ext.1 +rm -f $1_odeo.$ext.1 # Use reduce to accomplish the transformation -$SYMBOLIC >ode_r2lang.log << EOF +$SYMBOLIC << EOF #>ode_r2lang.log %Read the reduce definitions file in "$1_def.r"; %Read the reduce ODE file @@ -82,11 +85,13 @@ % Set up the code generator % Load the general translator package LOAD GENTRAN; GENTRANLANG!* := '$codegenerator; ON GENTRANSEG; -MAXEXPPRINTLEN!* := 40; +MAXEXPPRINTLEN!* := 80; +TEMPVARNUM!* := 1; +TEMPVARNAME!* := 'mtt_temp; % Matrix output function in"$MTTPATH/trans/lang_matrix.r"; %Set up the number of argument variables to zero in case the user has forgotten @@ -98,21 +103,21 @@ % The body of the ode function GENTRANOUT "$1_ode.$ext.1"; mtt_matrix := MTTdX$ mtt_matrix_n := MTTNx$ mtt_matrix_m := 1$ - mtt_matrix_name := MTTdX$ - lang_matrix(); + mtt_matrix_name := 'MTTdX$ + lang_matrix()$ GENTRANSHUT "$1_ode.$ext.1"; % The algebraic equations (if any) GENTRANOUT "$1_odea.$ext.1"; mtt_matrix := MTTYz$ mtt_matrix_n := MTTNYz$ mtt_matrix_m := 1$ mtt_matrix_name := MTTYz$ - lang_matrix(); + lang_matrix()$ GENTRANSHUT "$1_odea.$ext.1"; % Now do the y = g(x,t) function. % The body of the odeo function @@ -119,11 +124,11 @@ GENTRANOUT "$1_odeo.$ext.1"; mtt_matrix := MTTy$ mtt_matrix_n := MTTNy$ mtt_matrix_m := 1$ mtt_matrix_name := MTTy$ - lang_matrix(); + lang_matrix()$ GENTRANSHUT "$1_odeo.$ext.1"; EOF # Create the ode.$ext function @@ -228,10 +233,13 @@ % The output equations EOF sed 's/mtt_matrix/mtty/' $1_odeo.$ext.1 >> $1_odeo.$ext - +# Convert from Pascal syntax to Octave syntax +mv $1_ode.m mtt_junk; mtt_p2m $1_ode.m +mv $1_odeo.m mtt_junk; mtt_p2m $1_odeo.m +mv $1_odea.m mtt_junk; mtt_p2m $1_odea.m