Index: mttroot/mtt/bin/mtt ================================================================== --- mttroot/mtt/bin/mtt +++ mttroot/mtt/bin/mtt @@ -12,10 +12,13 @@ ############################################################### ## Version control history ############################################################### ## $Header$ ## $Log$ +# Revision 1.66 1997/04/16 09:46:01 peterg +# More informative copy message +# # Revision 1.65 1997/04/15 15:16:12 peterg # Added structure (_struc) files. # Fixed prob with dvi2ps conversion -- removed .doc extension. # # Revision 1.64 1997/04/09 09:26:44 peterg @@ -237,18 +240,23 @@ # MTT recursion level is zero unless explicitly set level=0 #Computation mode is octave by default computation=octave + +#By default, the dae and ode representations are different +dae_is_ode=0 #Look for a command line argument while [ -n "`echo $1 | grep '-'`" ]; do case $1 in -q ) quiet=quiet ;; -c ) computation=c ;; + -o ) + dae_is_ode=1 ;; -l ) level=$2; shift ;; esac shift done @@ -272,10 +280,13 @@ echo ' mtt clean' echo ' mtt copy ' echo ' mtt vc' echo ' mtt ' echo ' mtt ' + echo 'Options: -q quiet mode' + echo ' -c c-code generation' + echo ' -o ode and dae are the same' exit fi if [ "$1" = "info" ] && [ "$3" = "" ]; then @@ -590,23 +601,18 @@ sympar2numpar_r2m $1 #SUMMARY numpar numerical parameter declaration (c) $1_numpar.c: $1_sympar.r sympar2numpar_r2c $1 + #SUMMARY params numerical parameter setting (m) $1_params.m: - echo Creating $1_params.m - ( \ - echo "%% Parameter file for system $1 ($1_params.m)"; \ - echo "%% This file provides the system params for simulation:";\ - cat $MTTPATH/trans/m/rcs_header.txt; \ - echo; \ - )> $1_params.m + sympar2params_txt2m $1 #SUMMARY params numerical parameter setting (c) - $1_params.c: + $1_params.c: sympar2params_txt2c $1 #SUMMARY odes ODE simulation header file (h) $1_odes.h: echo Creating $1_odes.h @@ -723,10 +729,11 @@ $1_cbg.fig: $1_cbg.m $1_rbg.m $1_fig.fig $1_type.sh cbg_m2fig $1 #SUMMARY ese elementary system equations (r) #SUMMARY def definitions - system orders etc. (r) +#SUMMARY def definitions - system orders etc. (m) #SUMMARY struc structure - list of inputs, outputs and states (txt) #SUMMARY struc structure - list of inputs, outputs and states (tex) #SUMMARY struc structure - list of inputs, outputs and states (view) #Elementary system equations + definitions $1_ese.r: $1_cbg.m @@ -735,10 +742,12 @@ touch $1_def.r $1_struc.txt: $1_ese.r touch $1_struc.txt $1_struc.tex: $1_struc.txt struc_txt2tex $1 +$1_struc.m: $1_struc.txt + struc_txt2m $1 $1_def.m: $1_def.r def_r2m $1; matlab_tidy $1_def.m; #SUMMARY dae differential-algebraic equations (r) #SUMMARY dae differential-algebraic equations (m) @@ -773,12 +782,19 @@ #SUMMARY ode ordinary differential equations (c) #SUMMARY ode ordinary differential equations (tex) #SUMMARY ode ordinary differential equations (view) #SUMMARY ode ordinary differential equations (ps) #Ordinary differential equations +ifeq ($dae_is_ode,0) $1_ode.r: $1_cse.r $1_def.r $1_sympar.r cse2ode_r $1; tidy $1_ode.r +endif +ifeq ($dae_is_ode,1) +$1_ode.r: $1_dae.r + echo Copying $1_dae.r to $1_ode.r + cp $1_dae.r $1_ode.r +endif $1_ode.m: $1_def.r $1_ode.r $1_sympar.r ode_r2m $1; matlab_tidy $1_ode.m; matlab_tidy $1_odeo.m $1_ode.c: $1_def.r $1_ode.r $1_sympar.r $1_sympar.c ode_r2c $1 $1_ode.tex: $1_ode.r $1_sympar.r $1_simp.r @@ -828,11 +844,11 @@ #SUMMARY dm descriptor matrices (view) #SUMMARY dm descriptor matrices (ps) #Linearised system: descriptor matrices $1_dm.r: $1_dae.r $1_def.r $1_cr.r $1_ss.r $1_sympar.r dae2dm_r $1; tidy $1_dm.r -$1_dm.m: $1_def.r $1_dm.r $1_sympar.r $1_numpar.m +$1_dm.m: $1_def.m $1_dm.r $1_sympar.r $1_numpar.m dm_r2m $1; matlab_tidy $1_dm.m $1_dm.tex: $1_dm.r $1_sympar.r $1_simp.r dm_r2tex $1; latex_tidy $1_dm.tex