Index: mttroot/mtt/bin/mtt ================================================================== --- mttroot/mtt/bin/mtt +++ mttroot/mtt/bin/mtt @@ -12,10 +12,13 @@ ############################################################### ## Version control history ############################################################### ## $Header$ ## $Log$ +## Revision 1.169 1998/07/25 16:35:12 peterg +## Incorporated mtt_p2c (uses p2c) +## ## Revision 1.168 1998/07/25 09:44:25 peterg ## Uses Pascal as step on the way to c code -- MUCH nicer! ## State and input now use the simple default - no steady states ## ## Revision 1.167 1998/07/24 17:10:34 peterg @@ -1210,11 +1213,11 @@ txt2tex $1 cr r #SUMMARY sympar symbolic parameters (txt) # Lbl to sympar conversion ifeq ($switches,0) -$1_sympar.txt: $1_sub.sh +$1_sympar.txt: $1_sub.sh lbl2sympar_txt2txt $1 if [ "$level" = "0" ]; then \ mv $1_sympar.txt MTT_sympar.txt; \ else \ @@ -1274,10 +1277,21 @@ #SUMMARY sympar symbolic parameters (tex) # txt to tex (LaTeX) sympar conversion $1_sympar.tex: $1_sympar.txt sympar_txt2tex $1 +#SUMMARY switch Dynamic switch information (txt) +$1_switch.txt: $1_struc.txt + struc2switch_txt $1 +$1_switch.m: $1_switch.txt $1_sympars.txt + switch_txt2m $1 + +#SUMMARY sympars sympar + dynamic switch information (txt) +$1_sympars.txt: $1_sympar.txt $1_switch.txt + echo Creating $1_sympars.txt + cat $1_sympar.txt $1_switch.txt > $1_sympars.txt + #SUMMARY simp simplification information (r) $1_simp.r: echo Creating $1_simp.r ( \ echo "%% Reduce commands to simplify output for system $1 ($1_simp.r)"; \ @@ -1348,19 +1362,20 @@ $1_numpar.txt: mtt $mtt_switches -q -u $1 sympar txt; sympar2numpar_txt2txt $1 #SUMMARY numpar numerical parameter declaration (m) -$1_numpar.m: $1_numpar.txt $1_sympar.txt +$1_numpar.m: $1_numpar.txt $1_sympars.txt numpar_txt2m $1 #SUMMARY numpar numerical parameter declaration (c) $1_numpar.c: $1_numpar.txt $1_sympar.c txt2c $1 numpar #SUMMARY input numerical input declaration -- default (txt) -$1_input.txt: $1_struc.txt +$1_input.txt: + mtt -q $1 struc txt struc2input_txt2txt $1 #SUMMARY state numerical state declaration -- default (txt) $1_state.txt: mtt -q $1 struc txt @@ -1380,39 +1395,39 @@ # struc2input_txt2txt -s $1 #endif #SUMMARY input numerical input declaration (m) -$1_input.m: $1_input.txt $1_sympar.txt $1_ss.r +$1_input.m: $1_input.txt $1_sympars.txt $1_ss.r txt2m $1 input #SUMMARY state state declaration -- default (txt) #$1_state.txt: # mtt $mtt_switches $1 struc txt; # mtt $mtt_switches $1 ss r; # struc2state_txt2txt $1 #SUMMARY state state declaration (m) -$1_state.m: $1_state.txt $1_sympar.txt +$1_state.m: $1_state.txt $1_sympars.txt txt2m $1 state #SUMMARY state state declaration (c) #$1_state.c: $1_state.txt $1_sympar.txt # txt2c $1 state #SUMMARY input numerical input declaration (c) -ifeq ($switches,0) -$1_input.c: $1_input.txt $1_sympar.c - input_txt2c $1 -endif - -ifeq ($switches,1) -$1_switch.c: $1_struc.txt - struc2switch_txt2c $1 -$1_input.c: $1_input.txt $1_sympar.c $1_switch.c - input_txt2c -s $1 -endif +#ifeq ($switches,0) +#$1_input.c: $1_input.txt $1_sympar.c +# input_txt2c $1 +#endif +# +#ifeq ($switches,1) +#$1_switch.c: $1_struc.txt +# struc2switch_txt2c $1 +#$1_input.c: $1_input.txt $1_sympar.c $1_switch.c +# input_txt2c -s $1 +#endif #SUMMARY desc Verbal description of system (tex) $1_desc.tex: makedesc $1 @@ -1528,11 +1543,11 @@ #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 $1_sympar.txt +$1_ese.r: $1_cbg.m $1_sympar.txt cbg2ese_m2r $info_switch $1; ese_tidy $1 $1_def.r: $1_ese.r touch $1_def.r $1_struc.txt: $1_ese.r touch $1_struc.txt @@ -1602,11 +1617,11 @@ #$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 ode_r2tex $1; latex_tidy $1_ode.tex -$1_ode2odes.m : $1_def.r +$1_ode2odes.m : $1_def.r $1_sympars.txt make_ode2odes $1 #Conversion of m to p to c #SUMMARY ode ordinary differential equations (c) #SUMMARY ode ordinary differential equations (p) @@ -1622,12 +1637,14 @@ mtt_m2p $1_input.m $1_ode.p : $1_def.r $1_ode.m mtt_m2p $1_ode.m $1_odeo.p : $1_def.r $1_odeo.m mtt_m2p $1_odeo.m +$1_switch.p : $1_def.r $1_switch.m + mtt_m2p $1_switch.m $1_ode2odes.p : $1_def.r $1_simpar.p $1_numpar.p $1_state.p $1_input.p \ - $1_ode.p $1_odeo.p $1_ode2odes.m mtt_write.p + $1_ode.p $1_odeo.p $1_switch.p $1_ode2odes.m mtt_write.p mtt_m2p $1_ode2odes.m $1_ode2odes.c: $1_ode2odes.p mtt_p2c $info_switch $1 ode2odes @@ -1637,11 +1654,11 @@ #SUMMARY obs observer equations for CGPC (view) #SUMMARY obs observer equations for CGPC (ps) #Observer functions for GPC $1_obs.r: $1_ode.r $1_def.r $1_obspar.r $1_subs.r ode2obs_r $1; tidy $1_obs.r -$1_obs.m: $1_def.r $1_sympar.txt $1_obs.r $1_obspar.r $1_numpar.m +$1_obs.m: $1_def.r $1_sympars.txt $1_obs.r $1_obspar.r $1_numpar.m obs_r2m $1; matlab_tidy $1_obs.m $1_obs.tex: $1_obs.r $1_sympar.r $1_simp.r obs_r2tex $1; latex_tidy $1_obs.tex @@ -1854,20 +1871,19 @@ ode2odes_r2c $1 $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_odes.dat2: $1_ode2odes.m $1_ode.m $1_numpar.m $1_switch.m \ $1_def.m $1_input.m $1_state.m $1_simpar.m $1_smx.m echo Creating $1_odes.dat2 - octave -q $1_ode2odes.m> $1_odes.dat2 + time $MATRIX -q $1_ode2odes.m> $1_odes.dat2 endif ifeq ($computation,c) $1_odes.dat2: $1_ode2odes.c - echo Creating $1_odes.m - echo Creating $1_odeso.m + echo Creating $1_odes.dat2 echo 'Compiling ...' $CC $1_ode2odes.c -lm echo 'Running ...'; time ./a.out>$1_odes.dat2 ; echo 'Done.'