Index: mttroot/mtt/bin/trans/ode_r2lang ================================================================== --- mttroot/mtt/bin/trans/ode_r2lang +++ mttroot/mtt/bin/trans/ode_r2lang @@ -13,17 +13,21 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## 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 ## ############################################################### # Set up the language specific stuff language=$2 + case $language in m) ext='m'; codegenerator='FORTRAN' Lc='#'; @@ -37,12 +41,20 @@ Lc='/*'; Rc='*/'; Lb='['; Rb=']'; ;; - *) - echo Language $2 not supported - sorry; exit 1 + java) + ext='java'; + codegenerator='C' + Lc='/*'; + Rc='*/'; + Lb='['; + Rb=']'; + ;; + *) + echo Language $2 not supported - sorry; exit 1 esac #Inform user echo Creating $1_ode.$ext echo Creating $1_odea.$ext @@ -113,11 +125,11 @@ GENTRANSHUT "$1_odeo.$ext.1"; EOF # Create the ode.$ext function -lang_header $1 ode $ext 'mttx,t' mttdx > $1_ode.$ext +lang_header $1 ode $ext 'mttx,mttu,t' mttdx > $1_ode.$ext # Algebraic bits $MATRIX -q <> $1_ode.$ext %System structure [nx,ny,nu,nz,nyz] = $1_def; @@ -152,15 +164,21 @@ EOF cat <> $1_ode.$ext -% The differential equations +$Lc The differential equations $Rc EOF sed 's/mtt_matrix/mttdx/' $1_ode.$ext.1 >> $1_ode.$ext +# Java terminating } +if [ "$language" = "java" ]; then +cat <> $1_ode.$ext +} +EOF +fi # Create the odea.$ext function lang_header $1 odea $ext 'mttui' mttyz 'global mttxx mttt; mttx = mttxx; t=mttt;' > $1_odea.$ext @@ -182,11 +200,11 @@ EOF sed 's/mtt_matrix/mttyz/' $1_odea.$ext.1 >> $1_odea.$ext # Create the odeo.$ext function -lang_header $1 odeo $ext 'mttx,t' mtty > $1_odeo.$ext +lang_header $1 odeo $ext 'mttx,mttu,t' mtty > $1_odeo.$ext $MATRIX -q <> $1_odeo.$ext %System structure [nx,ny,nu,nz,nyz] = $1_def; if nyz>0 @@ -209,12 +227,11 @@ cat <> $1_odeo.$ext % The output equations EOF sed 's/mtt_matrix/mtty/' $1_odeo.$ext.1 >> $1_odeo.$ext -