ADDED mttroot/mtt/bin/trans/can_r2tex Index: mttroot/mtt/bin/trans/can_r2tex ================================================================== --- /dev/null +++ mttroot/mtt/bin/trans/can_r2tex @@ -0,0 +1,137 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: sm_r2tex +# Reduce constrained-state matrices to LaTex constrained-state matrices. +# P.J.Gawthrop 9 Sep 1991, May 1994 +# Copyright (c) P.J.Gawthrop, 1991, May 1994, 1996. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +# Revision 1.3 1997/06/13 13:50:11 peterg +# Matrices in amstex format +# +# Revision 1.2 1997/04/18 12:54:00 peterg +# No longer does labels. +# +# Revision 1.1 1996/08/19 15:19:23 peter +# Initial revision +# +############################################################### + + +# Inform user +echo Creating $1_sm.tex + +# Remove the old log file +rm -f sm_r2tex.log + +# Use reduce to accomplish the transformation +reduce >sm_r2tex.log << EOF + +%Read the definitions file +in "$1_def.r"; + +%Read the constrained-state matrices file +in "$1_sm.r"; + +%Read the symbolic parameters file +in "$1_sympar.r"; + +%Read the simplification file +in "$1_simp.r"; + + +OFF Echo; +OFF Nat; +OFF EXP; +%ON Rounded; +%Precision 5; + + +OUT "$1_sm.tex"; + +%Write out the state matrices. +write "%state matrices $1"; +write "%File: $1.rcm"; +write""; + +write "%constrained-state matrices"; + +IF MTTNx>0 THEN +BEGIN +write "% - A matrix"; +write "\begin{equation}"; +write "MTTA = \begin{pmatrix}"; + FOR Row := 1:MTTNx DO + BEGIN + FOR Col := 1:MTTNx DO + BEGIN + Write "{", MTTA(Row,Col), "}"; + IF Col0 + +write "% - D matrix"; +write "\begin{equation}"; +write "MTTD = \begin{pmatrix}"; + FOR Row := 1:MTTNy DO + BEGIN + FOR Col := 1:MTTNu DO + BEGIN + Write "{", MTTD(Row,Col), "}"; + IF Col