Overview
| Comment: | *** empty log message *** |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | descendants | both | origin/master | trunk |
| Files: | files | file ages | folders |
| SHA3-256: |
7c534b51f60f612c3b6d07d9b046d6c1 |
| User & Date: | gawthrop@users.sourceforge.net on 2000-12-28 12:53:10.000 |
| Other Links: | branch diff | manifest | tags |
Context
|
2000-12-28
| ||
| 17:04:39 | To RCS check-in: 9405d8f836 user: gawthrop@users.sourceforge.net tags: origin/master, trunk | |
| 12:53:10 | *** empty log message *** check-in: 7c534b51f6 user: gawthrop@users.sourceforge.net tags: origin/master, trunk | |
| 12:48:53 | Put under RCS check-in: f928abb12e user: gawthrop@users.sourceforge.net tags: origin/master, trunk | |
Changes
Modified mttroot/mtt/bin/trans/numpar_txt2c
from [0406b76cc5]
to [a692cf3be8].
| ︙ | ︙ | |||
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | # Copyright (c) P.J.Gawthrop, 1997. ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ # Revision 1.4 1997/05/15 08:33:07 peterg # Declare state array (x). # # Revision 1.3 1997/05/03 15:01:42 peterg # Don't write out RCS headers. # # Revision 1.2 1997/05/01 08:35:18 peterg # # is now the comment symbol in the .txt file # # Revision 1.1 1997/05/01 08:25:31 peterg # Initial revision # ############################################################### | > > > | > > | | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# Copyright (c) P.J.Gawthrop, 1997.
###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.5 1997/06/13 09:42:25 peterg
## Auto change of () to []
##
# Revision 1.4 1997/05/15 08:33:07 peterg
# Declare state array (x).
#
# Revision 1.3 1997/05/03 15:01:42 peterg
# Don't write out RCS headers.
#
# Revision 1.2 1997/05/01 08:35:18 peterg
# # is now the comment symbol in the .txt file
#
# Revision 1.1 1997/05/01 08:25:31 peterg
# Initial revision
#
###############################################################
system=$1
representation = $2
# Inform user
echo "Creating $1_numpar.c"
rm -f mtt_error
#Write some file headers
echo '/*' > $1_numpar.c
echo "Parameter file for system $1 ($1_numpar.c)" >> $1_numpar.c
echo "This file provides the system numerical parameters in c form" >> $1_numpar.c
echo "Generated by MTT at `date`" >> $1_numpar.c
echo '*/' >> $1_numpar.c
echo >> $1_numpar.c
echo "extern double x[MTTNX1];" >> $1_numpar.c
echo "#include \"$1_sympar.c\"" >> $1_numpar.c
echo "$1_numpar()" >> $1_numpar.c
echo '{' >> $1_numpar.c
#Write out the variables in c format.
sed 's/#C-CODE //'< $1_numpar.txt |\
awk -F# '{
if (NF<2) print $1
if (NF>1) print $1 "/* " $2 " */"
}' | sed 's/(\([0-9]*\))/[\1]/' >> $1_numpar.c
echo '}' >> $1_numpar.c
|
Modified mttroot/mtt/bin/trans/numpar_txt2m
from [8a709831a5]
to [55a143892d].
| ︙ | ︙ | |||
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | # Copyright (c) P.J.Gawthrop 1996 ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ # Revision 1.2 1997/05/01 08:24:38 peterg # Now uses # as the comment symbol in the .txt file # # Revision 1.1 1997/05/01 07:45:17 peterg # Initial revision # ############################################################### # Inform user echo Creating $1_numpar.m #Create the numpar file complete with headers. | > > > < | | | | < < | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# Copyright (c) P.J.Gawthrop 1996
###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.3 1998/07/25 18:26:33 peterg
## *** empty log message ***
##
# Revision 1.2 1997/05/01 08:24:38 peterg
# Now uses # as the comment symbol in the .txt file
#
# Revision 1.1 1997/05/01 07:45:17 peterg
# Initial revision
#
###############################################################
# Inform user
echo Creating $1_numpar.m
#Create the numpar file complete with headers.
lang_header $1 numpar m '' MTTpar > $1_numpar.m
# Global variable list
#echo >> $1_numpar.m
#echo "# Global variable list" >> $1_numpar.m
#sympar2global_txt2m $1 >> $1_numpar.m
#Write out the variables in m format.
awk -F# '{
if (NF==1) print $1
if (NF==2) print $1 "# " $2
}' $1_numpar.txt |\
sed 's/double/global/' >> $1_numpar.m
|
Modified mttroot/mtt/bin/trans/ode_r2c
from [3aa29e9779]
to [572667c334].
| ︙ | ︙ | |||
16 17 18 19 20 21 22 23 24 25 26 27 28 29 | # Copyright (c) P.J.Gawthrop 1997. ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ # Revision 1.4 1997/05/01 13:44:19 peterg # Changed double to float. # # Revision 1.3 1997/03/20 14:51:11 peterg # Includes the sympar.c file. # # Revision 1.2 1997/01/21 22:57:17 peterg | > > > | 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | # Copyright (c) P.J.Gawthrop 1997. ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ ## Revision 1.5 1997/05/01 13:50:55 peterg ## Replaced float by double. ## # Revision 1.4 1997/05/01 13:44:19 peterg # Changed double to float. # # Revision 1.3 1997/03/20 14:51:11 peterg # Includes the sympar.c file. # # Revision 1.2 1997/01/21 22:57:17 peterg |
| ︙ | ︙ | |||
49 50 51 52 53 54 55 | %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 symbolic parameters file | | | 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | %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 symbolic parameters file %%in "$1_sympar.r"; %Read the reduce state-space equations file in "$1_ode.r"; ON BigFloat, NumVal; PRECISION 16; %Compatible with Matlab |
| ︙ | ︙ | |||
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 | SHUT "$1_ode.c1"; % Load the general translator package LOAD GENTRAN; GENTRANLANG!* := 'C; ON GENTRANSEG; MAXEXPPRINTLEN!* := 80; % let it know that sign is a function GENTRAN DECLARE sign : function; GENTRANOUT "$1_ode.c2"; %Do the translation %State IF MTTNx>0 THEN BEGIN FOR i := 1:MTTNx DO | > > > | 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 | SHUT "$1_ode.c1"; % Load the general translator package LOAD GENTRAN; GENTRANLANG!* := 'C; ON GENTRANSEG; MAXEXPPRINTLEN!* := 80; ON DOUBLE; % let it know that sign is a function GENTRAN DECLARE sign : function; GENTRAN DECLARE r_switch : function; GENTRAN DECLARE i_switch : function; GENTRANOUT "$1_ode.c2"; %Do the translation %State IF MTTNx>0 THEN BEGIN FOR i := 1:MTTNx DO |
| ︙ | ︙ |
Modified mttroot/mtt/bin/trans/struc2input_txt2txt
from [811485b466]
to [280b194479].
| ︙ | ︙ | |||
10 11 12 13 14 15 16 17 18 19 20 21 22 23 | # Copyright (c) P.J.Gawthrop 1997 ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ ## Revision 1.13 2000/03/03 11:33:19 peterg ## *** empty log message *** ## ## Revision 1.12 1998/08/10 14:29:05 peterg ## Removed -s (switches) stuff ## ## Revision 1.11 1998/08/10 14:23:58 peterg | > > > > > | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | # Copyright (c) P.J.Gawthrop 1997 ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ ## Revision 1.14 2000/10/16 08:28:56 peterg ## Tidied up: ## SS broken due to incorrect ss.r file ## Switches?? ## ## Revision 1.13 2000/03/03 11:33:19 peterg ## *** empty log message *** ## ## Revision 1.12 1998/08/10 14:29:05 peterg ## Removed -s (switches) stuff ## ## Revision 1.11 1998/08/10 14:23:58 peterg |
| ︙ | ︙ | |||
96 97 98 99 100 101 102 |
if (length(u[i])==0) u[i]="0.0;";
# print "u(" i ") =\t", u[i], " \# " $4 " (" $3 ")"
printf("%s =\t%s # MTT initial value from steady state\n", $4, u[i]);
}
}' >> $1_input.txt
else
#Write out the defaults -- unit inputs
| | > | > > | 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 |
if (length(u[i])==0) u[i]="0.0;";
# print "u(" i ") =\t", u[i], " \# " $4 " (" $3 ")"
printf("%s =\t%s # MTT initial value from steady state\n", $4, u[i]);
}
}' >> $1_input.txt
else
#Write out the defaults -- unit inputs
echo Creating $1_input.txt - using defaults
awk '{
if ($1=="input") {
if ($2==1)
printf("%s = \t%s; # MTT initial value\n", $4, default)
else
printf("%s = \t%s; # MTT initial value\n", $4, "0.0")
}
}' Nu=$Nu default=$default <$1_struc.txt >> $1_input.txt
fi
#Set some switches
# echo >> $1_input.txt
# echo "# Set the switches" >> $1_input.txt
# strip_comments<$1_switch.txt |\
# awk '{if (length($1)>0) print tolower($1) "= (t>=0);"}' >> $1_input.txt
|
Modified mttroot/mtt/bin/trans/sympar_r2c
from [167bebd5e0]
to [4377d90700].
1 2 3 4 5 6 |
#! /bin/sh
######################################
##### Model Transformation Tools #####
######################################
| | < < | < < < < < < < | | < | < < < | | < < < < < < < < < < < < < < > > > > | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
#! /bin/sh
######################################
##### Model Transformation Tools #####
######################################
# Bourne shell script: sympar_r2c
# Convert symbolic parameters to a c declaration list
# Copyright (c) P.J.Gawthrop 1997.
###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
# Revision 1.1 1997/03/01 11:20:36 peterg
# Initial revision
###############################################################
# Inform user
echo Creating $1_sympar.c
# Remove the old log file
rm -f sympar_r2c.log
# Use reduce to accomplish the transformation
reduce >sympar_r2c.log << EOF
%Read the symbolic parameters file
in "$1_sympar.r";
%Generate the global variable list.
OUT "$1_sympar.c";
%External (global) variable list
write "/* Symbolic paramaters for system $1 */ "$
write "/* Generated by MTT */ "$
write "/* External (global) variable list */ "$
IF MTTNvar>0 THEN
BEGIN
FOR i := 1:MTTNvar DO
IF numberp(MTTVar(i,1))
THEN
BEGIN
% Do nowt
END
ELSE
BEGIN
write "extern double ", MTTVar(i,1), ";"$
END$
END$
SHUT "$1_sympar.c";
EOF
|
Modified mttroot/mtt/bin/trans/sympar_txt2m
from [06b6d0d20c]
to [edc3797ff8].
1 2 3 4 5 6 7 8 9 10 11 12 13 |
#!/bin/sh
## Converts sympar.txt to an m file which provides indices in the form
## sympar.name = i
######################################
##### Model Transformation Tools #####
######################################
# Copyright (C) 2000 by Peter J. Gawthrop
echo Creating $1_sympar.m
| | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
#!/bin/sh
## Converts sympar.txt to an m file which provides indices in the form
## sympar.name = i
######################################
##### Model Transformation Tools #####
######################################
# Copyright (C) 2000 by Peter J. Gawthrop
echo Creating $1_sympar.m
lang_header -noglobals $1 sympar m "" sympar > $1_sympar.m
awk '{
printf(" sympar.%s \t= %i; # %s\n", $1, ++i, $2);
}' < $1_sympar.txt >> $1_sympar.m
|