Index: mttroot/mtt/bin/mtt ================================================================== --- mttroot/mtt/bin/mtt +++ mttroot/mtt/bin/mtt @@ -12,10 +12,13 @@ ############################################################### ## Version control history ############################################################### ## $Header$ ## $Log$ +## Revision 1.226 2000/02/10 18:51:31 peterg +## Included OFF exp; in subs.r default +## ## Revision 1.225 2000/02/10 15:03:10 peterg ## Put subs.r file into the m-code generation -- allows the off exp; ## switch for simpler expresions. ## ## Revision 1.224 2000/02/08 10:27:04 peterg @@ -796,10 +799,13 @@ # Default integration method integration_method=implicit; # Default no info info_switch='' + +# Default use m, not oct files +m='m'; #Initialise list mtt_switches=''; @@ -879,10 +885,13 @@ mtt_switches="$mtt_switches $1"; start_at_abg='yes';; -stdin ) mtt_switches="$mtt_switches $1"; stdin=stdin;; + -oct ) + mtt_switches="$mtt_switches $1"; + m='oct';; --version) echo 'MTT version' $version; exit;; --versions) mtt_versions; exit;; *) @@ -947,11 +956,12 @@ echo ' -d use directory ' echo ' -dc Maximise derivative (not integral) causality' echo ' -dc Maximise derivative (not integral) causality' echo ' -i implicit Use implicit integration' echo ' -i euler Use Euler integration' - echo ' -o ode is same as dae' + echo ' -o ode is same as dae' + echo ' -oct use oct files in place of m files where appropriate' echo ' -p print environment variables' echo ' -r reset time stamp on representation' echo ' -s try to generate sensitivity BG (experimental)' echo ' -ss use steady-state info to initialise simulations' echo ' -stdin read input data from standard input for simulations' @@ -1611,21 +1621,21 @@ echo Creating $1_simp.r ( \ echo "%% Reduce commands to simplify output for system $1 ($1_simp.r)"; \ cat $MTTPATH/trans/m/rcs_header.txt; \ echo 'END;'; \ - )> $1_simp.r + )> $1_simp.r #SUMMARY subs algebraic substitution (r) $1_subs.r: echo Creating $1_subs.r ( \ echo "%% Reduce substitution statements for system $1 ($1_subs.r)"; \ cat $MTTPATH/trans/m/rcs_header.txt; \ - echo "OFF exp; % Don't expand expressions"; \ + echo "OFF exp; % Don't expand expressions"; \ echo 'END;'; \ - )> $1_subs.r + )> $1_subs.r #SUMMARY obspar GPC observability function parameters (r) $1_obspar.r: echo Creating $1_obspar.r ( \ @@ -1644,29 +1654,29 @@ echo 'MTTUU(1,2) := MTTu11;'; \ echo 'MTTUU(1,3) := MTTu12;'; \ echo 'MTTUU(1,4) := MTTu13;'; \ echo 'MTTUU(1,5) := MTTu14;'; \ echo 'END;'; \ - )> $1_obspar.r + )> $1_obspar.r #SUMMARY simpar simulation information (txt) $1_simpar.txt: echo Creating $1_simpar.txt ( \ - echo '# -*-octave-*- Put Emacs into octave-mode'; \ + echo '# -*-octave-*- Put Emacs into octave-mode'; \ echo "# Simulation parameters for system $1 ($1_simpar.txt)"; \ echo "# Generated by MTT on" `date`.; \ cat $MTTPATH/trans/rcs_header.sh; \ - echo ;\ + echo ;\ echo 'LAST = 10.0; # Last time in simulation'; \ echo 'DT = 0.1; # Print interval'; \ echo 'STEPFACTOR = 1; # Integration steps per print interval'; \ echo 'WMIN = -1; # Minimum frequency = 10^WMIN'; \ echo 'WMAX = 2; # Maximum frequency = 10^WMAX'; \ echo 'WSTEPS = 100; # Number of frequency steps'; \ echo 'INPUT = 1; # Index of the input'; \ - )> $1_simpar.txt + )> $1_simpar.txt #SUMMARY simpar simulation information (m) $1_simpar.m: $1_simpar.txt txt2m $1 simpar @@ -1765,11 +1775,11 @@ ( \ echo "%% Parameter file for system $1 ($1_params.r)"; \ echo "%% This file provides symbolic parameters for simplification";\ cat $MTTPATH/trans/m/rcs_header.txt; \ echo 'END;'; \ - )> $1_params.r + )> $1_params.r #SUMMARY sspar steady-state definition (r) $1_sspar.r: struc2sspar_txt2r $1 @@ -1937,10 +1947,13 @@ $1_ode.m: $1_def.m $1_ode.r $1_subs.r $1_sympars.txt mtt_r2m $1 ode m; matlab_tidy $1_ode.m $1_ode.oct: $1_def.r $1_ode.p $1_sympars.txt mtt_p2oct $1 ode + +$1_odeo.oct: $1_def.r $1_odeo.p $1_sympars.txt + mtt_p2oct $1 odeo $1_odea.m: $1_ode.m touch $1_odea.m $1_odeo.m: $1_ode.m touch $1_odeo.m @@ -1950,18 +1963,18 @@ ode_r2tex $1; latex_tidy $1_ode.tex # The main simulation programme ifeq ($integration_method,implicit) $1_ode2odes.m : $1_def.r $1_sympars.txt $1_smx.m\ - $1_simpar.m $1_numpar.m $1_state.m $1_input.m \ - $1_cse.m $1_cseo.m $1_switchopen.m + $1_simpar.m $1_numpar.m $1_state.m $1_input.m \ + $1_cse.m $1_cseo.m $1_switchopen.m make_ode2odes $1 $integration_method endif ifeq ($integration_method,euler) $1_ode2odes.m : $1_def.r $1_sympars.txt\ - $1_simpar.m $1_numpar.m $1_state.m $1_input.m \ - $1_ode.m $1_odeo.m $1_switchopen.m + $1_simpar.m $1_numpar.m $1_state.m $1_input.m \ + $1_ode.$m $1_odeo.$m $1_switchopen.m make_ode2odes $1 $integration_method endif #Conversion of m to p to c @@ -1997,18 +2010,18 @@ $1_switchopen.p : $1_def.r $1_switchopen.m mtt_m2p $1_switchopen.m ifeq ($integration_method,implicit) $1_ode2odes.p : $1_ode2odes.m $1_def.r $1_smx.p\ - $1_simpar.p $1_numpar.p $1_state.p $1_input.p \ - $1_cse.p $1_cseo.p $1_switchopen.p + $1_simpar.p $1_numpar.p $1_state.p $1_input.p \ + $1_cse.p $1_cseo.p $1_switchopen.p mtt_m2p $1_ode2odes.m $integration_method $stdin endif ifeq ($integration_method,euler) $1_ode2odes.p : $1_ode2odes.m $1_def.r\ - $1_simpar.p $1_numpar.p $1_state.p $1_input.p \ - $1_ode.p $1_odeo.p $1_switchopen.p + $1_simpar.p $1_numpar.p $1_state.p $1_input.p \ + $1_ode.p $1_odeo.p $1_switchopen.p mtt_m2p $1_ode2odes.m $integration_method $stdin endif $1_ode2odes.c: $1_ode2odes.p mtt_p2c $info_switch $1 ode2odes @@ -2288,11 +2301,11 @@ $1_sms.c: $1_sm.c $1_def.r $1_sympar.r sm2sms_r2c $1 ifeq ($computation,octave) $1_odes.dat2: $1_ode2odes.m $1_ode.m $1_numpar.m $1_switchopen.m \ - $1_def.m $1_input.m $1_state.m $1_simpar.m + $1_def.m $1_input.m $1_state.m $1_simpar.m time octave_ode2odes $1 endif ifeq ($computation,c) $1_ode2odes.out: $1_ode2odes.c