ADDED mttroot/mtt/bin/trans/m/fig3.m Index: mttroot/mtt/bin/trans/m/fig3.m ================================================================== --- /dev/null +++ mttroot/mtt/bin/trans/m/fig3.m @@ -0,0 +1,67 @@ +function first_line = fig3(object,thickness,colour) +% first_line = fig3(object,thickness,colour) +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%% Model Transformation Tools %%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Matlab function fig3.m +% Provides the "first line" format for polyines and text objects +% See fig 3 documentation for details +% +% P.J.Gawthrop June 1996 +% Copyright (c) P.J.Gawthrop, 1996. + +red = 4; +blue = 1; + +if (object==2) %Polyline + sub_type = 1; + line_style = 0; + + if nargin<2 + thickness = 3; + end; + + if nargin<3 + colour = red; + end; + + fill_colour = -1; + depth = 0; + pen_style = 0; + area_fill = -1; + style_val = 0.0; + join_style = 0; + cap_style = 0; + radius = -1; + f_arrow = 0; + b_arrow = 0; + npoints = 2; + first_line = [... + int2str(object), ' ', ... + int2str(sub_type), ' ', ... + int2str(line_style), ' ', ... + int2str(thickness), ' ', ... + int2str(colour), ' ', ... + int2str(fill_colour), ' ', ... + int2str(depth), ' ', ... + int2str(pen_style), ' ', ... + int2str(area_fill), ' ', ... + num2str(style_val), ' ' ... + int2str(join_style), ' ', ... + int2str(cap_style), ' ', ... + int2str(radius), ' ', ... + int2str(f_arrow), ' ', ... + int2str(b_arrow), ' ', ... + int2str(npoints)]; + +elseif (object==4) %text + + +else + error('Object must be 2 (polyline) or 4(text)'); +end; + + + ADDED mttroot/mtt/bin/trans/mtt_mend_lines Index: mttroot/mtt/bin/trans/mtt_mend_lines ================================================================== --- /dev/null +++ mttroot/mtt/bin/trans/mtt_mend_lines @@ -0,0 +1,18 @@ +#!/bin/sh + +# Copyright (C) 2000 by Peter J. Gawthrop + +# Fixes broken lines from reduce. + +#sed 's/[^#]\(.*\)[^;]$/\1\\/' + +awk '{ + if ((match($1,"#")==0)&&(match($1,"global")==0)&&(match($1,"endfunction")==0)) { + if(match($0,";")!=length($0)) + printf("%s \\\n",$0) + else + print $0 + } + else print $0 + +}' ADDED mttroot/mtt/bin/trans/rcs_header.m Index: mttroot/mtt/bin/trans/rcs_header.m ================================================================== --- /dev/null +++ mttroot/mtt/bin/trans/rcs_header.m @@ -0,0 +1,9 @@ + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % $Id$ +% % $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + ADDED mttroot/mtt/bin/trans/struc2sspar_txt2r Index: mttroot/mtt/bin/trans/struc2sspar_txt2r ================================================================== --- /dev/null +++ mttroot/mtt/bin/trans/struc2sspar_txt2r @@ -0,0 +1,43 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: struc2sspar_txt2txt +# Creates the deafault numerical parameters file for the system (txt) + +# Copyright (c) P.J.Gawthrop 1998 + + +# Inform user +echo Creating $1_sspar.r + + +#Write out the default ss values (0) +#Create the sspar file complete with headers. +echo "% Steady-state parameter file ($1_sspar.r)" > $1_sspar.r +echo "% Generated by MTT at `date`" >> $1_sspar.r +cat $MTTPATH/trans/rcs_header.m >> $1_sspar.r + +echo >> $1_sspar.r + +echo "% Steady-state states" >> $1_sspar.r +awk '{ + if ($1=="state") + print "MTTX" $2 " := \t0; \% " $4 " (" $3 ")" +}' \ + $1_struc.txt >> $1_sspar.r + + +echo "% Steady-state inputs" >> $1_sspar.r +awk '{ + if ($1=="input") + print "MTTU" $2 " := \t0; \% " $4 " (" $3 ")" +}' \ + $1_struc.txt >> $1_sspar.r + + +echo ";;END;" >> $1_sspar.r + +