ADDED mttroot/mtt/bin/trans/ss_r2m Index: mttroot/mtt/bin/trans/ss_r2m ================================================================== --- /dev/null +++ mttroot/mtt/bin/trans/ss_r2m @@ -0,0 +1,94 @@ +#! /bin/sh + + ###################################### + ##### Model Transformation Tools ##### + ###################################### + +# Bourne shell script: ss_r2m +# Reduce steady-state values to Fortran +# P.J.Gawthrop 10 July 1990, Dec 1993, Jan 1994, May 1994. +# Copyright (c) P.J.Gawthrop, 1989, 1990, 1993, 1994. + +############################################################### +## Version control history +############################################################### +## $Id$ +## $Log$ +############################################################### + +#Inform user +echo Creating $1_ss.m +# Remove the old log file +rm -f ss_r2m.log + +# Usv reduce to accomplish the transformation +reduce >ss_r2m.log << EOF + +%Read the reduce definitions file +in "$1_def.r"; + +%Set up the number of argument variables to zero in case the user has forgotten +MTTNVar := 0; + +%Read the reduce steady-state values file +in "$1_ss.r"; + +%Read in the parameter file +in "$1_sympar.r"; + +ON BigFloat, numval; +PRECISION 16; %Compatible with Matlab + +OUT "$1_ss.m"; +%Headings - Matlab style +%(Note. The ;; are deleted by for2mat) + +IF MTTNvar>0 THEN +BEGIN + write "function [MTTX0,MTTY0,MTTU0] = $1_ss(..."; + FOR i := 1:MTTNvar DO + BEGIN + IF i0 THEN +BEGIN + write "%function [MTTX0,MTTY0,MTTU0] = $1_ss(..."; + FOR i := 1:MTTNvar DO + BEGIN + IF i