ADDED mttroot/mtt/bin/trans/cbg2sese_m2r Index: mttroot/mtt/bin/trans/cbg2sese_m2r ================================================================== --- /dev/null +++ mttroot/mtt/bin/trans/cbg2sese_m2r @@ -0,0 +1,126 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + + ############################################################### + ## Version control history + ############################################################### + ## $Id$ + ## $Log$ + ## Revision 1.3 2003/03/13 09:00:22 peterg + ## Revised for new mtt_component_eqn arg list + ## + ## Revision 1.2 2003/03/11 10:16:03 peterg + ## Removed NAME argument + ## + ## Revision 1.1 2003/03/11 10:08:49 peterg + ## Initial revision + ## + ## + ############################################################### + +## cbg2seqn_m2r: Converts causal bond graph into sorted equations +## Copyright (C) 2003 by Peter J. Gawthrop + + +strucfile=$1_struc.txt +outfile=$1_sese.r +make=mtt_make_sese.m +CD='%%%% =====' +## Inform user +echo Creating ${outfile} + +## Header +create_header() { +cat< ${outfile} +cat >> ${outfile}<> ${outfile} +done + + +## Create a file of octave commands +create_octave_header > ${make} +which_list="state output" +for which in ${which_list}; do + create_octave ${which} >> ${make} +done + + +## Execute the m file +octave -q < ${make} >> ${outfile} + +## Tail +cat >> ${outfile}<> ${outfile} +done + +cat<> ${outfile} +END; +EOF