Index: mttroot/mtt/bin/mtt ================================================================== --- mttroot/mtt/bin/mtt +++ mttroot/mtt/bin/mtt @@ -17,10 +17,13 @@ ############################################################### ## Version control history ############################################################### ## $Header$ ## $Log$ +## Revision 1.12 1996/08/15 16:47:47 peter +## DAE solution (experimental) included. +## ## Revision 1.11 1996/08/15 11:55:30 peter ## Checks for changed argument. ## Handles frequency response. ## ## Revision 1.10 1996/08/15 07:44:24 peter @@ -106,34 +109,61 @@ # Save up the argument list in a file; but only if argument has changed ARGS=$4; cat > $1_args.new < $1_lbl.txt @@ -140,28 +170,44 @@ $1_cr.r: makecr $1 $1_sympar.r: echo Creating $1_sympar.r ( \ - echo "%% Symbolic parameter file ($1_sympar.r)"; \ + echo "%% Symbolic parameter file for $1 ($1_sympar.r)"; \ echo "%% Change the following line to reflect the number of variables"; \ echo "MTTNVar := 0;"; \ echo "IF MTTNVar>0 THEN MATRIX MTTVar(MTTNVar,1);"; \ echo "%% Add an assignment statement here for each variable"; \ echo "%% For example: MTTVar(1,1) := r"; \ )> $1_sympar.r $1_simp.r: echo Creating $1_simp.r ( \ - echo "%% Reduce comands to simplify output ($1_simp.r)"; \ + echo "%% Reduce comands to simplify output for $1 ($1_simp.r)"; \ )> $1_simp.r + $1_numpar.m: $1_sympar.r mknumpar $1; matlab_tidy $1_numpar.m; +$1_input.m: + echo Creating $1_input.m + ( \ + echo "function u = $1_input(t)"; \ + echo "%% Input file for $1 ($1_input.m)"; \ + echo "%% This file provides the system input for simulation:";\ + echo; \ + echo "% Set up system definitions"; \ + echo "[nx,ny,nu,nz,nyz] = $1_def;"; \ + echo "% Change the following lines as you wish"; \ + echo "u = zeros(nu,1);"; \ + echo "u(1) = 1;"; \ + )> $1_input.m + $1_sspar.r: echo Creating $1_sspar.r - echo "%% Reduce steady-state parameter file ($1_sspar.r)" > $1_sspar.r + echo "%% Reduce steady-state parameter file for $1 ($1_sspar.r)" \ + > $1_sspar.r #Raw bond graph: fig file to mfile $1_rbg.m: $1_abg.fig $1_lbl.txt rbg_fig2m $1 @@ -276,13 +322,13 @@ #Time responses $1_sr.m: $1_dm.m $1_numpar.m $1_args.m $1_def.m dm2sr_m $1 '$ARGS' -$1_odesol.m: $1_ode.m $1_numpar.m $1_args.m $1_def.m +$1_odesol.m: $1_ode.m $1_numpar.m $1_args.m $1_def.m $1_input.m ode2odesol_m $1 '$ARGS' -$1_daesol.m: $1_dae.m $1_numpar.m $1_args.m $1_def.m +$1_daesol.m: $1_dae.m $1_numpar.m $1_args.m $1_def.m $1_input.m dae2daesol_m $1 '$ARGS' #Frequency responses $1_fr.m: $1_dm.m $1_numpar.m $1_args.m $1_def.m dm2fr_m $1 '$ARGS' @@ -317,31 +363,36 @@ $1_$2.dvi: $1_$2.doc echo Creating $1_$2.dvi latex $1_$2.doc > /dev/null #Create PostScript version of fig files -%.ps : %.fig +ifeq ($REPTYPE,bg) +$1_$2.ps : $1_$2.fig echo Creating $1_$2.ps fig2dev -Lps $1_$2.fig >$1_$2.ps - +endif +ifeq ($REPTYPE,data) #Create PostScript version of dat file -%.ps: %.gdat +$1_$2.ps: $1_$2.gdat gdat2ps $1_$2 '$ARGS' +endif +ifeq ($REPTYPE,tex) #Create PostScript version of dvi file -%.ps: %.dvi +$1_$2.ps: $1_$2.dvi echo Creating $1_$2.ps dvips -o $1_$2.ps $1_$2 +endif #View a ps file $1_$2.view: $1_$2.ps echo Creating view of $1_$2 ghostview $1_$2.ps& #View a gdat file -#%.view: %.gdat +#$1_$2.view: $1_$2.gdat # echo Creating view of $1_$2 # gdat2view $1_$2 '$ARGS'& #Report generation