Index: mttroot/mtt/bin/trans/abg2cbg_m ================================================================== --- mttroot/mtt/bin/trans/abg2cbg_m +++ mttroot/mtt/bin/trans/abg2cbg_m @@ -11,10 +11,13 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.12 1998/07/10 08:43:46 peterg +## Added -I switch +## ## Revision 1.11 1998/01/23 13:29:54 peterg ## $RMATRIX --> $MATRIX ## # Revision 1.10 1996/12/04 21:51:02 peterg # Now uses filenum instead of line name. @@ -113,10 +116,11 @@ esac shift done infofile='mtt_info.txt' +errorfile='mtt_error.txt' typefile="$1_type.sh" # Remove the old log file rm -f abg2cbg_m.log rm -f $1_cbg.m @@ -127,25 +131,24 @@ #Inform user echo Creating $1_cbg.m echo Creating $1_type.sh # Use matrix manipulation to accomplish the transformation -$MATRIX << EOF >abg2cbg_m.log 2>mtt_error.txt +$MATRIX << EOF >abg2cbg_m.log #2>mtt_error.txt - infofile= '$infofile'; - typefile = '$typefile'; - infofilenum = fopen(infofile,'w'); - typefilenum = fopen(typefile,'w'); + infofilenum = fopen("$infofile",'w'); + errorfilenum = fopen("$errorfile",'w'); + typefilenum = fopen("$typefile",'w'); %Convert from acausal to causal bond graph in m-file form. system_name='$1'; port_bonds = []; port_direction = []; port_status = []; [cbonds,status] = abg2cbg(system_name, '', '', port_bonds, port_direction, port_status, ... - typefilenum, infofilenum); + typefilenum, infofilenum, errorfilenum); EOF if [ "$info" = "info" ]; then cat $infofile Index: mttroot/mtt/bin/trans/awk/rbg_fig2m.awk ================================================================== --- mttroot/mtt/bin/trans/awk/rbg_fig2m.awk +++ mttroot/mtt/bin/trans/awk/rbg_fig2m.awk @@ -11,10 +11,14 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.31 1998/04/16 13:18:13 peterg +## Now ignores spurious ports (in lbl but not Figure \ref{) but gives +## warning +## ## Revision 1.30 1998/04/12 15:01:17 peterg ## Converted to uniform port notation - always use [] ## ## Revision 1.29 1998/04/12 12:35:32 peterg ## Named and unnamed SS handled in a uniform manner - in particular, the @@ -179,11 +183,10 @@ function write_component(i) { name = label[i,1]; cr = label[i,2]; arg = label[i,3]; - if (length(x[name])==0) { # print error - its in lbl but not fig file printf(warning_l, name); } else { @@ -522,11 +525,11 @@ b_file = sprintf("%s_rbg.m", sys_name); c_file = sprintf("%s_cmp.m", sys_name); fig_file = sprintf("%s_fig.fig", sys_name); cmp_file = sprintf("%s_cmp.fig", sys_name); - bnd_file = sprintf("%s_bnd.fig", sys_name); + bnd_file = sprintf("%s_bnd.fig", sys_name); head_file = sprintf("%s_head.fig", sys_name); warning_f = "WARNING %s \t in fig file but not lbl file - using\n"; warning_l = "WARNING %s \t in lbl file but not fig file - ignoring\n"; warning_p = "ERROR system ports are not consecutively numbered\n"; @@ -568,14 +571,13 @@ component_index = 0; } { # Start of .fig file? - if ( (NF>0) && (match("#FIG", $1) > 0) ) { + if ($1=="#FIG") { isa_fig_file=1; } - if (isa_fig_file==0) { process_lbl() } else { process_fig() Index: mttroot/mtt/bin/trans/dae2dm_r ================================================================== --- mttroot/mtt/bin/trans/dae2dm_r +++ mttroot/mtt/bin/trans/dae2dm_r @@ -12,10 +12,13 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +# Revision 1.2 1996/08/25 09:53:35 peter +# Error handling added. +# ## Revision 1.1 1996/08/18 20:03:51 peter ## Initial revision ## ############################################################### @@ -29,11 +32,11 @@ reduce >dae2dm_r.log << EOF in "$1_def.r"; in "$1_dae.r"; in "$1_cr.r"; -in "$1_sympar.r"; +%%in "$1_sympar.r"; OFF Echo; OFF Nat; @@ -241,13 +244,35 @@ BEGIN uj := MTTU(j,1); MTTD(i,j) := df(MTTY(i,1), uj, 1); END; END; + +%Zap the dz terms (not a nice way) +MTTdz1 := 0; +MTTdz2 := 0; +MTTdz3 := 0; +MTTdz4 := 0; +MTTdz5 := 0; +MTTdz6 := 0; +MTTdz7 := 0; +MTTdz8 := 0; +MTTdz9 := 0; +MTTdz10 := 0; +MTTdz11 := 0; +MTTdz12 := 0; +MTTdz13 := 0; +MTTdz14 := 0; +MTTdz15 := 0; +MTTdz16 := 0; +MTTdz17 := 0; +MTTdz18 := 0; +MTTdz19 := 0; + %Substitute the ss values -in "$1_ss.r"; +in "$1_sspar.r"; %Create the output file OUT "$1_dm.r"; %Write out the matrices.