ADDED mttroot/mtt/bin/trans/mtt_make_sim Index: mttroot/mtt/bin/trans/mtt_make_sim ================================================================== --- /dev/null +++ mttroot/mtt/bin/trans/mtt_make_sim @@ -0,0 +1,82 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + + +# Bourne shell script: mtt_make_sim +# Copyright (C) 2000 by Peter J. Gawthrop + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + +# Tell user +Sys=$1 +method=$2 + +if [ -z "$method" ]; then + method=implicit +fi +# +echo "Creating $1_sim.m with $method integration method" + +if [ $method = "implicit" ]; then + ode=cse + odeo=cseo +else + ode=ode + odeo=odeo +fi + +# Find system constants +Nx=`mtt_getsize $Sys x` # States +Nu=`mtt_getsize $Sys u` # Inputs +Ny=`mtt_getsize $Sys y` # Inputs + +# Header +lang_header -noglobal $1 sim m 'x0,u,t,par' '[y,x]' > $1_sim.m + +cat >> $1_sim.m <