Index: mttroot/mtt/bin/mtt ================================================================== --- mttroot/mtt/bin/mtt +++ mttroot/mtt/bin/mtt @@ -15,10 +15,13 @@ ############################################################### ## Version control history ############################################################### ## $Header$ ## $Log$ +## Revision 1.318 2001/07/24 04:17:30 gawthrop +## Removed all " from #SUMMARY lines - messes up xmtt +## ## Revision 1.317 2001/07/24 00:55:17 gawthrop ## Resolved clashes -- marked with ## >>> ## ## Revision 1.316 2001/07/22 19:24:03 geraint ## Multiple '-v' increases verbosity. @@ -2537,11 +2540,11 @@ ${sys}_cse.r: ${Subsystem}_dae.r ${Subsystem}_dae.r ${Subsystem}_def.r ${Subsystem}_subs.r ifneq ($partition,) echo Doing subsystems mtt_make_subsystems ${sys} cse r endif - dae2cse_r $Solve ${Subsystem}; tidy ${Subsystem}_cse.r #$1_subs.r + dae2cse_r $optimise $Solve ${Subsystem}; tidy ${Subsystem}_cse.r #$1_subs.r $1_csex.r: $1_cse.r touch $1_csex.r $1_cseo.r: $1_cse.r touch $1_cseo.r @@ -2605,11 +2608,11 @@ $1_ode.r: $1_dae.r echo Copying $1_dae.r to $1_ode.r cp $1_dae.r $1_ode.r else $1_ode.r: $1_cse.r $1_cseo.r $1_def.r $1_sympar.r $1_subs.r - cse2ode_r $1; tidy $1_ode.r + cse2ode_r $optimise $1; tidy $1_ode.r endif $1_odeo.r: $1_ode.r touch $1_odeo.r @@ -2624,11 +2627,11 @@ $1_ode.tex: $1_ode.r $1_sympar.r $1_simp.r ode_r2tex $1; latex_tidy $1_ode.tex $1_lde.r: $1_dae.r - dae2lde_r $1; tidy $1_lde.r + dae2lde_r $optimise $1; tidy $1_lde.r $1_lde.tex: $1_lde.r $1_sympar.r $1_simp.r lde_r2tex $1; latex_tidy $1_lde.tex # The main simulation programme @@ -2849,11 +2852,11 @@ #SUMMARY sm state matrices (c) #SUMMARY sm* state matrices (view) #SUMMARY sm state matrices (ps) #Linearised system: state matrices $1_sm.r: $1_csm.r $1_def.r $1_cr.r $1_ss.r $1_sympar.r - csm2sm_r $1 sm; tidy $1_sm.r + csm2sm_r $optimise $1 sm; tidy $1_sm.r $1_sm.m: $1_def.r $1_sm.r $1_sympars.txt mtt_r2m $optimise -parameters $1 sm $1_sm.icad: $1_sm.m $1_numpar.m sm_m2icad $1 $1_sm.c: $1_def.r $1_sm.r $1_sympar.c @@ -2866,11 +2869,11 @@ #SUMMARY ssm sensitivity state matrices (tex) #SUMMARY ssm sensitivity state matrices (c) #SUMMARY ssm sensitivity state matrices (ps) #Linearised system: sensitivity state matrices $1_ssm.r: $1_scsm.r $1_def.r $1_cr.r $1_ss.r $1_sympar.r - csm2sm_r $1 ssm; tidy $1_ssm.r + csm2sm_r $optimise $1 ssm; tidy $1_ssm.r $1_ssm.m: $1_def.r $1_ssm.r $1_sympars.txt mtt_r2m $optimise -parameters $1 ssm $1_ssm.tex: $1_ssm.r $1_sympar.r $1_simp.r sm_r2tex $1 ssm; latex_tidy $1_ssm.tex Index: mttroot/mtt/bin/trans/cse2ode_r ================================================================== --- mttroot/mtt/bin/trans/cse2ode_r +++ mttroot/mtt/bin/trans/cse2ode_r @@ -12,10 +12,13 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.2 2001/07/13 04:54:04 geraint +## Branch merge: numerical-algebraic-solution back to main. +## ## Revision 1.1.4.1 2001/05/04 04:07:24 geraint ## Numerical solution of algebraic equations. ## sys_ae.cc written for unsolved inputs. ## Solution of equations using hybrd from MINPACK (as used by Octave fsolve). ## @@ -27,18 +30,30 @@ ## ## Revision 1.1 1996/08/25 10:05:45 peter ## Initial revision ## ############################################################### + +optimise=''; optimise_msg='' +while [ -n "`echo $1 | grep '^-'`" ]; do + case $1 in + -optimise) + optimise='-optimise' + optimise_msg=' with optimisation' ;; + *) + echo "$1 is an invalid argument - ignoring" ;; + esac + shift +done # Create the reduce output code -def2write_r $1 ode -def2write_r $1 odeo +def2write_r $optimise $1 ode +def2write_r $optimise $1 odeo #Inform user -echo Creating $1_ode.r -echo Creating $1_odeo.r +echo Creating $1_ode.r $optimise_msg +echo Creating $1_odeo.r $optimise_msg # Remove the old log file rm -f cse2ode_r.log # Use reduce to accomplish the transformation Index: mttroot/mtt/bin/trans/csm2sm_r ================================================================== --- mttroot/mtt/bin/trans/csm2sm_r +++ mttroot/mtt/bin/trans/csm2sm_r @@ -12,24 +12,39 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.1 2000/12/28 12:24:03 peterg +## Put under RCS +## ## Revision 1.2 1996/08/25 10:11:32 peter ## Added END in output file. ## Error handling. ## ## Revision 1.1 1996/08/19 15:06:16 peter ## Initial revision ## ############################################################### + +optimise=''; optimise_msg='' +while [ -n "`echo $1 | grep '^-'`" ]; do + case $1 in + -optimise) + optimise='-optimise' + optimise_msg=' with optimisation' ;; + *) + echo "$1 is an invalid argument - ignoring" ;; + esac + shift +done # Create the reduce output code -def2write_r $1 $2 +def2write_r $optimise $1 $2 # Inform user -echo Creating $1_$2.r +echo Creating $1_$2.r $optimise_msg case $2 in sm) rep=csm; ;; 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.16 2001/07/13 04:54:04 geraint +## Branch merge: numerical-algebraic-solution back to main. +## ## Revision 1.15.2.4 2001/06/26 00:55:48 geraint ## Writes algebraic equation Jacobian _aej.r (not used yet). ## ## Revision 1.15.2.3 2001/05/09 00:19:22 geraint ## Fixed EOF error when MTTNYZ=0. @@ -93,35 +96,35 @@ ## Revision 1.1 1996/08/15 16:47:02 peter ## Initial revision ## ############################################################### -#Explicit solution option -solve=0 +#Explicit solution option and optimise option +solve=0; solve_msg='' +optimise=''; optimise_msg='' while [ -n "`echo $1 | grep '^-'`" ]; do case $1 in -A ) - solve=1;; + solve=1 + solve_msg=' with explicit solution of algebraic equations' ;; + -optimise) + optimise='-optimise' + optimise_msg=' with optimisation' ;; *) echo "$1 is an invalid argument - ignoring" ;; esac shift done # Create the reduce output code -def2write_r $1 cse -def2write_r $1 csex # Version without E matrix -def2write_r $1 cseo - -if [ "$solve" = "1" ]; then - echo "Creating $1_cse.r (with explicit solution of algebraic equations)" -else - echo "Creating $1_cse.r" -fi - -echo "Creating $1_csex.r" -echo "Creating $1_cseo.r" +def2write_r $optimise $1 cse +def2write_r $optimise $1 csex # Version without E matrix +def2write_r $optimise $1 cseo + +echo "Creating $1_cse.r $solve_msg $optimise_msg" +echo "Creating $1_csex.r $optimise_msg" +echo "Creating $1_cseo.r $optimise_msg" # Remove the old log file rm -f dae2cse_r.log # Remove some files Index: mttroot/mtt/bin/trans/dae2lde_r ================================================================== --- mttroot/mtt/bin/trans/dae2lde_r +++ mttroot/mtt/bin/trans/dae2lde_r @@ -11,19 +11,34 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.1 2000/12/28 12:25:13 peterg +## Initial revision +## ############################################################### + +optimise=''; optimise_msg='' +while [ -n "`echo $1 | grep '^-'`" ]; do + case $1 in + -optimise) + optimise='-optimise' + optimise_msg=' with optimisation' ;; + *) + echo "$1 is an invalid argument - ignoring" ;; + esac + shift +done # Create the reduce output code -def2write_r $1 lde -def2write_r $1 ldeo +def2write_r $optimise $1 lde +def2write_r $optimise $1 ldeo #Inform user -echo Creating $1_lde.r -echo Creating $1_ldeo.r +echo Creating $1_lde.r $optimise_msg +echo Creating $1_ldeo.r $optimise_msg # Remove the old log file rm -f cse2lde_r.log # Use reduce to accomplish the transformation Index: mttroot/mtt/bin/trans/def2write_r ================================================================== --- mttroot/mtt/bin/trans/def2write_r +++ mttroot/mtt/bin/trans/def2write_r @@ -11,10 +11,13 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.8 2001/07/13 04:54:04 geraint +## Branch merge: numerical-algebraic-solution back to main. +## ## Revision 1.7.2.1 2001/05/04 04:07:24 geraint ## Numerical solution of algebraic equations. ## sys_ae.cc written for unsolved inputs. ## Solution of equations using hybrd from MINPACK (as used by Octave fsolve). ## @@ -40,16 +43,28 @@ ## ## Revision 1.1 2000/10/10 09:07:32 peterg ## Initial revision ## ############################################################### + +optimise='' +while [ -n "`echo $1 | grep '^-'`" ]; do + case $1 in + -optimise) + opt='-optimise' + optimise_msg=' with optimisation' ;; + *) + echo "$1 is an invalid argument - ignoring" ;; + esac + shift +done sys=$1 # System name rep=$2 # System representation # Inform User -echo Creating $1_$2_write.r +echo Creating $1_$2_write.r $optimise_msg # Find system constants Nx=`mtt_getsize $sys x` # States Nxx=`mtt_getsize $sys xx` # States x States Nu=`mtt_getsize $sys u` # Inputs @@ -103,23 +118,35 @@ echo def2write_r: representation $rep not recognised exit esac # Write out the code -echo 'off echo$ load scope$' >$1_$2_write.r +echo 'off echo$' >$1_$2_write.r + +if [ ${opt:-""} = "-optimise" ]; then + echo 'load scope$' +else + echo 'load gentran$' +fi >> $1_$2_write.r for matrix in $matrices; do n=`first "$ns"`; ns=`rest "$ns"` m=`first "$ms"`; ms=`rest "$ms"` is=`n2m 1 $n`; js=`n2m 1 $m`; for i in $is; do for j in $js; do - echo 'optimize' >>$1_$2_write.r - name=`echo MTT$matrix'('$i','$j')'` - echo ' '$comma$name ':=:' $name >>$1_$2_write.r - echo 'INAME mtt_tmp$' >>$1_$2_write.r - comma='' + if [ ${opt:-""} = "-optimise" ]; then + echo 'optimize' + name=`echo MTT$matrix'('$i','$j')'` + echo ' '$comma$name ':=:' $name + echo 'INAME mtt_tmp$' + comma='' + else + echo 'write' + name=`echo MTT$matrix'('$i','$j')'` + echo ' '$comma$name ':=' $name '$' + fi >> $1_$2_write.r done done done echo 'END$' >>$1_$2_write.r